aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongik Cha <jeongik@google.com>2021-07-21 07:56:48 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-07-21 07:56:48 +0000
commit2426ed1f1a365e8c39ab32ffbe31b6be494f6c1e (patch)
tree40206be5d73a97c3b4838b071eae7e98445c6c4e
parent3fe6886360b935adc1408c19866a9f2b7fc0d275 (diff)
parent9effa07f5b0577c5147e05c0dd5da9379b305fd5 (diff)
downloadlibconfig-2426ed1f1a365e8c39ab32ffbe31b6be494f6c1e.tar.gz
Import libconfig am: 1199caa2e8 am: 604433215f am: 9effa07f5b
Original change: https://android-review.googlesource.com/c/platform/external/libconfig/+/1772393 Change-Id: I9a99a0bffbdaf571fa30a0a68cee511581b090cd
-rw-r--r--AUTHORS7
-rw-r--r--CMakeLists.txt35
-rw-r--r--COPYING.LIB510
-rw-r--r--ChangeLog821
-rw-r--r--INSTALL255
-rw-r--r--LICENSE504
-rw-r--r--METADATA18
-rw-r--r--MODULE_LICENSE_LGPL0
-rw-r--r--Makefile.am49
-rw-r--r--NEWS0
-rw-r--r--OWNERS4
-rw-r--r--README78
-rw-r--r--README.md7
-rw-r--r--TODO39
-rw-r--r--_config.yml1
-rw-r--r--ac_config.h.in116
-rwxr-xr-xaux-build/compile347
-rwxr-xr-xaux-build/config.guess1568
-rwxr-xr-xaux-build/config.rpath666
-rwxr-xr-xaux-build/config.sub1793
-rwxr-xr-xaux-build/depcomp791
-rwxr-xr-xaux-build/install-sh527
-rw-r--r--aux-build/ltmain.sh9655
-rwxr-xr-xaux-build/missing215
-rwxr-xr-xaux-build/mkinstalldirs162
-rwxr-xr-xaux-build/test-driver139
-rw-r--r--aux-build/texinfo.tex10079
-rwxr-xr-xaux-build/ylwrap247
-rw-r--r--configure.ac163
-rw-r--r--contrib/README3
-rw-r--r--contrib/chained/README.md60
-rw-r--r--contrib/chained/examples/CMakeLists.txt40
-rw-r--r--contrib/chained/examples/CreateProjectFiles.bat7
-rw-r--r--contrib/chained/examples/README.md43
-rw-r--r--contrib/chained/examples/example.cfg52
-rw-r--r--contrib/chained/examples/example1.cpp52
-rw-r--r--contrib/chained/examples/example2.cpp71
-rw-r--r--contrib/chained/examples/example3.cpp66
-rw-r--r--contrib/chained/examples/examples.cpp69
-rw-r--r--contrib/chained/libconfig_chained.h542
-rwxr-xr-xcontrib/cmake/1_configure.sh5
-rwxr-xr-xcontrib/cmake/2_make.sh4
-rw-r--r--contrib/cmake/CMakeFiles/CMakeCCompiler.cmake36
-rw-r--r--contrib/cmake/CMakeFiles/CMakeCXXCompiler.cmake36
-rw-r--r--contrib/cmake/CMakeFiles/CMakeSystem.cmake15
-rw-r--r--contrib/cmake/CMakeFiles/CompilerIdC/CMakeCCompilerId.c182
-rw-r--r--contrib/cmake/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp169
-rw-r--r--contrib/cmake/CMakeLists.txt22
-rw-r--r--contrib/cmake/cmake_work/FindConfig++.cmake23
-rw-r--r--contrib/cmake/cmake_work/FindConfig.cmake23
-rw-r--r--contrib/cmake/cmake_work/cmake_uninstall.cmake.in36
-rw-r--r--contrib/cmake/src/CMakeLists.txt6
-rw-r--r--contrib/cmake/src/main.cpp13
-rw-r--r--contrib/copy_setting.c161
-rw-r--r--contrib/libconfig-ruby/README76
-rw-r--r--contrib/libconfig-ruby/Rakefile17
-rw-r--r--contrib/libconfig-ruby/ext/extconf.rb11
-rw-r--r--contrib/libconfig-ruby/ext/rconfig.c700
-rw-r--r--contrib/ls-config/LICENSE339
-rw-r--r--contrib/ls-config/README.md21
-rw-r--r--contrib/ls-config/debian/README9
-rw-r--r--contrib/ls-config/debian/changelog5
-rw-r--r--contrib/ls-config/debian/compat1
-rw-r--r--contrib/ls-config/debian/control17
-rw-r--r--contrib/ls-config/debian/copyright33
-rw-r--r--contrib/ls-config/debian/files1
-rw-r--r--contrib/ls-config/debian/ls-config.1103
-rw-r--r--contrib/ls-config/debian/ls-config.debhelper.log48
-rw-r--r--contrib/ls-config/debian/ls-config.install6
-rw-r--r--contrib/ls-config/debian/ls-config.substvars1
-rw-r--r--contrib/ls-config/debian/ls-config/DEBIAN/control12
-rw-r--r--contrib/ls-config/debian/ls-config/DEBIAN/md5sums2
-rwxr-xr-xcontrib/ls-config/debian/ls-config/DEBIAN/postinst39
-rw-r--r--contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/changelog.gzbin0 -> 146 bytes
-rw-r--r--contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/copyright33
-rw-r--r--contrib/ls-config/debian/manpages1
-rw-r--r--contrib/ls-config/debian/postinst68
-rwxr-xr-xcontrib/ls-config/debian/rules13
-rw-r--r--contrib/ls-config/debian/source/format1
-rw-r--r--contrib/ls-config/doc/bash.api.txt75
-rw-r--r--contrib/ls-config/doc/bin.api.txt75
-rw-r--r--contrib/ls-config/doc/changlog.txt26
-rw-r--r--contrib/ls-config/doc/errorcodes.txt20
-rw-r--r--contrib/ls-config/lslib-core199
-rw-r--r--contrib/ls-config/makefile7
-rw-r--r--contrib/ls-config/sample/config23
-rwxr-xr-xcontrib/ls-config/sample/script68
-rw-r--r--contrib/ls-config/src/ls-config.c1345
-rw-r--r--contrib/ls-config/src/makefile34
-rw-r--r--contrib/ls-config/src/po/en_GB.po289
-rw-r--r--contrib/ls-config/src/po/ls-config.pot287
-rw-r--r--contrib/ls-config/src/po/makefile34
-rw-r--r--contrib/ls-config/src/po/pl_PL.po292
-rw-r--r--debian/changelog185
-rw-r--r--debian/compat1
-rw-r--r--debian/control163
-rw-r--r--debian/copyright37
-rw-r--r--debian/dirs1
-rw-r--r--debian/docs3
-rw-r--r--debian/libconfig++-dev.examples3
-rw-r--r--debian/libconfig++-dev.install4
-rw-r--r--debian/libconfig++9-dev.install6
-rw-r--r--debian/libconfig++9.install1
-rw-r--r--debian/libconfig++9v5.install1
-rw-r--r--debian/libconfig-dev.examples2
-rw-r--r--debian/libconfig-dev.info1
-rw-r--r--debian/libconfig-dev.install4
-rw-r--r--debian/libconfig-doc.doc-base9
-rw-r--r--debian/libconfig-doc.docs1
-rw-r--r--debian/libconfig9-dev.docs1
-rw-r--r--debian/libconfig9-dev.install5
-rw-r--r--debian/libconfig9.info1
-rw-r--r--debian/libconfig9.install1
-rwxr-xr-xdebian/rules14
-rw-r--r--debian/shlibs2
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch5
-rw-r--r--doc/LGPL.texi590
-rw-r--r--doc/Makefile.am7
-rw-r--r--doc/libconfig.texi2452
-rw-r--r--docs/_config.yml1
-rw-r--r--docs/dist/libconfig-1.7.1.tar.gzbin0 -> 715486 bytes
-rw-r--r--docs/dist/libconfig-1.7.2.tar.gzbin0 -> 721362 bytes
-rw-r--r--docs/dist/libconfig-1.7.tar.gzbin0 -> 713999 bytes
-rw-r--r--docs/index.md41
-rw-r--r--docs/libconfig_manual.html3810
-rw-r--r--docs/libconfig_manual.pdfbin0 -> 329309 bytes
-rw-r--r--docs/test.cfg.txt78
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--examples/Makefile.am6
-rw-r--r--examples/c++/CMakeLists.txt20
-rw-r--r--examples/c++/Makefile.am16
-rw-r--r--examples/c++/cxx_example1.vcproj185
-rw-r--r--examples/c++/cxx_example1.vcxproj337
-rw-r--r--examples/c++/cxx_example1.vcxproj.filters26
-rw-r--r--examples/c++/cxx_example2.vcproj185
-rw-r--r--examples/c++/cxx_example2.vcxproj337
-rw-r--r--examples/c++/cxx_example2.vcxproj.filters26
-rw-r--r--examples/c++/cxx_example3.vcproj185
-rw-r--r--examples/c++/cxx_example3.vcxproj345
-rw-r--r--examples/c++/cxx_example3.vcxproj.filters26
-rw-r--r--examples/c++/cxx_example4.vcproj181
-rw-r--r--examples/c++/cxx_example4.vcxproj334
-rw-r--r--examples/c++/cxx_example4.vcxproj.filters21
-rw-r--r--examples/c++/example.cfg46
-rw-r--r--examples/c++/example1.cpp151
-rw-r--r--examples/c++/example2.cpp102
-rw-r--r--examples/c++/example3.cpp71
-rw-r--r--examples/c++/example4.cpp57
-rw-r--r--examples/c++/invalid.cfg8
-rw-r--r--examples/c/CMakeLists.txt17
-rw-r--r--examples/c/Makefile.am17
-rw-r--r--examples/c/cfg_includes/book1.cfg6
-rw-r--r--examples/c/cfg_includes/book2.cfg6
-rw-r--r--examples/c/cfg_includes/book3.cfg6
-rw-r--r--examples/c/cfg_includes/book4.cfg9
-rw-r--r--examples/c/cfg_includes/cfg_subincludes/extra1.cfg1
-rw-r--r--examples/c/cfg_includes/cfg_subincludes/extra2.cfg1
-rw-r--r--examples/c/cfg_includes/other.cfg0
-rw-r--r--examples/c/example.cfg46
-rw-r--r--examples/c/example1.c115
-rw-r--r--examples/c/example1.vcproj185
-rw-r--r--examples/c/example1.vcxproj337
-rw-r--r--examples/c/example1.vcxproj.filters26
-rw-r--r--examples/c/example2.c97
-rw-r--r--examples/c/example2.vcproj185
-rw-r--r--examples/c/example2.vcxproj337
-rw-r--r--examples/c/example2.vcxproj.filters26
-rw-r--r--examples/c/example3.c79
-rw-r--r--examples/c/example3.vcproj185
-rw-r--r--examples/c/example3.vcxproj345
-rw-r--r--examples/c/example3.vcxproj.filters26
-rw-r--r--examples/c/example4.c137
-rw-r--r--examples/c/example4.cfg9
-rw-r--r--lib/CMakeLists.txt140
-rw-r--r--lib/Makefile.am97
-rw-r--r--lib/grammar.c1867
-rw-r--r--lib/grammar.h116
-rw-r--r--lib/grammar.y389
-rw-r--r--lib/libconfig++.pc.in14
-rw-r--r--lib/libconfig++.vcproj263
-rw-r--r--lib/libconfig++.vcxproj337
-rw-r--r--lib/libconfig++.vcxproj.filters79
-rw-r--r--lib/libconfig++Config.cmake.in7
-rw-r--r--lib/libconfig.c1777
-rw-r--r--lib/libconfig.h355
-rw-r--r--lib/libconfig.h++574
-rw-r--r--lib/libconfig.hh23
-rw-r--r--lib/libconfig.pc.in14
-rw-r--r--lib/libconfig.vcproj250
-rw-r--r--lib/libconfig.vcxproj317
-rw-r--r--lib/libconfig.vcxproj.filters74
-rw-r--r--lib/libconfigConfig.cmake.in7
-rw-r--r--lib/libconfigcpp.c++1487
-rw-r--r--lib/libconfigcpp.cc23
-rw-r--r--lib/parsectx.h49
-rw-r--r--lib/scanctx.c198
-rw-r--r--lib/scanctx.h109
-rw-r--r--lib/scanner.c2616
-rw-r--r--lib/scanner.h719
-rw-r--r--lib/scanner.l202
-rw-r--r--lib/strbuf.c74
-rw-r--r--lib/strbuf.h42
-rw-r--r--lib/strvec.c74
-rw-r--r--lib/strvec.h43
-rw-r--r--lib/util.c122
-rw-r--r--lib/util.h35
-rw-r--r--lib/win32/stdint.h221
-rw-r--r--lib/wincompat.c61
-rw-r--r--lib/wincompat.h118
-rw-r--r--libconfig.spec.in81
-rw-r--r--libconfig_vs2008.sln105
-rw-r--r--libconfig_vs2017.sln223
-rw-r--r--m4/libtool.m47982
-rw-r--r--m4/ltoptions.m4384
-rw-r--r--m4/ltsugar.m4123
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m498
-rw-r--r--test.cfg82
-rw-r--r--tests/CMakeLists.txt22
-rw-r--r--tests/Makefile.am18
-rw-r--r--tests/testdata/bad_input_0.cfg1
-rw-r--r--tests/testdata/bad_input_1.cfg7
-rw-r--r--tests/testdata/input_0.cfg0
-rw-r--r--tests/testdata/input_1.cfg3
-rw-r--r--tests/testdata/input_2.cfg18
-rw-r--r--tests/testdata/input_3.cfg7
-rw-r--r--tests/testdata/input_4.cfg8
-rw-r--r--tests/testdata/input_5.cfg1
-rw-r--r--tests/testdata/input_6.cfg5
-rw-r--r--tests/testdata/more.cfg2
-rw-r--r--tests/testdata/output_0.cfg0
-rw-r--r--tests/testdata/output_1.cfg0
-rw-r--r--tests/testdata/output_2.cfg3
-rw-r--r--tests/testdata/output_3.cfg3
-rw-r--r--tests/testdata/output_4.cfg2
-rw-r--r--tests/testdata/output_5.cfg1
-rw-r--r--tests/testdata/output_6.cfg0
-rw-r--r--tests/testdata/override_setting.cfg20
-rw-r--r--tests/testdata/parse_error_0.txt1
-rw-r--r--tests/testdata/parse_error_1.txt1
-rw-r--r--tests/testdata/strings.cfg10
-rw-r--r--tests/tests.c574
-rw-r--r--tests/tests.vcproj237
-rw-r--r--tests/tests.vcxproj334
-rw-r--r--tests/tests.vcxproj.filters65
-rw-r--r--tinytest/CMakeLists.txt17
-rw-r--r--tinytest/Makefile.am6
-rw-r--r--tinytest/tinytest.c730
-rw-r--r--tinytest/tinytest.h538
-rw-r--r--tinytest/tinytest.vcproj168
-rw-r--r--tinytest/tinytest.vcxproj289
-rw-r--r--tinytest/tinytest.vcxproj.filters23
253 files changed, 72267 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..ab6a491
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,7 @@
+
+Mark Lindner - Lead developer & maintainer.
+Daniel Marjamäki - Enhancements & bugfixes.
+Andrew Tytula - Windows port.
+Glenn Herteg - Enhancements, bugfixes, documentation corrections.
+Matt Renaud - Enhancements & bugfixes.
+JoseLuis Tallon - Enhancements & bugfixes
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..a797610
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1)
+
+# Extract version from configure.ac.
+set(VERSION_REGEX "^AC_INIT\\(libconfig,[ \t]+([0-9.]+),.*")
+file(STRINGS "configure.ac"
+ VERSION_STRING REGEX ${VERSION_REGEX})
+string(REGEX REPLACE ${VERSION_REGEX} "\\1" VERSION_STRING "${VERSION_STRING}")
+
+project(libconfig LANGUAGES C CXX VERSION ${VERSION_STRING})
+option(BUILD_EXAMPLES "Enable examples" ON)
+option(BUILD_SHARED_LIBS "Enable shared library" ON)
+option(BUILD_TESTS "Enable tests" ON)
+
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_EXTENSIONS ON)
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)
+
+include(GNUInstallDirs)
+include(CheckSymbolExists)
+add_subdirectory(lib)
+
+if(BUILD_EXAMPLES)
+ add_subdirectory(examples)
+endif()
+
+if(BUILD_TESTS)
+ enable_testing()
+ add_subdirectory(tinytest)
+ add_subdirectory(tests)
+endif()
diff --git a/COPYING.LIB b/COPYING.LIB
new file mode 100644
index 0000000..b124cf5
--- /dev/null
+++ b/COPYING.LIB
@@ -0,0 +1,510 @@
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard. To achieve this, non-free programs must
+be allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at least
+ three years, to give the same user the materials specified in
+ Subsection 6a, above, for a charge no more than the cost of
+ performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should
+have at least the "copyright" line and a pointer to where the full
+notice is found.
+
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James
+ Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..6e4b809
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,821 @@
+
+----- version 1.7.3 ------
+
+2021-06-19 Mark Lindner <markl@avalon>
+
+ * lib/libconfig.c - Fixed double-free of config->filenames;
+ fixed implementation of config_setting_lookup() to correctly return
+ NULL instead of the passed-in setting if the specified path was not
+ found
+ * configure.ac, lib/Makefile.am - bump version numbers
+
+2021-04-28 Mark Lindner <markl@avalon>
+
+ * lib/CMakeLists.txt - misc. fixes
+
+2021-04-22 Mark Lindner <markl@avalon>
+
+ * Makefile.am, configure.ac - Added --disable-tests configure option
+
+2021-01-09 Mark Lindner <markl@avalon>
+
+ * lib/CMakeLists.txt - misc. fixes
+
+2020-11-12 Mark Lindner <markl@avalon>
+
+ * contrib/ls-config/README.md - typo corrections
+
+2020-10-03 Mark Lindner <markl@avalon>
+
+ * *.vcxproj, *.sln - Updated for building x64 configuration.
+
+2020-07-02 Mark Lindner <markl@avalon>
+
+ * lib/libconfig.h++, doc/libconfig.texi - added isString() convenience
+ method
+
+2019-12-18 Mark Lindner <markl@avalon>
+
+ * lib/libconfig.c, lib/libconfig.h, lib/libconfig.h++,
+ tests/testdata/override_setting.cfg, tests/tests.c,
+ doc/libconfig.texi - Added new ALLOW_OVERRIDES option.
+
+2019-12-17 Mark Lindner <markl@avalon>
+
+ * CMakeLists.txt, tests/CMakeList.txt - various fixes
+ * lib/libconfig.c, lib/scanctx.c, lib/scanner.h, lib/scanner.l,
+ lib/strvec.c, lib/strvec.h, lib/util.c, lib/util.h - prefix more
+ internal functions with 'libconfig_'
+ * lib/scanner.c, lib/scanner.h - regenerated
+
+2019-12-14 Mark Lindner <markl@avalon>
+
+ * lib/grammar.y, lib/scanner.l, lib/libconfig.c, lib/parsectx.h,
+ lib/scanctx.h, lib/scanctx.c, lib/strbuf.c, lib/strbuf.h,
+ lib/strvec.c, lib/strvec.h - prefix all internal functions with
+ 'libconfig_'
+ * lib/grammar.c, lib/grammar.h, lib/scanner.c, lib/scanner.h - regenerated
+ * lib/wincompat.h - Fix #define for snprintf for Visual Studio 2013
+ * lib/libconfig.h++, lib/libconfigcpp.c++ - Use noexcept in C++17
+
+----- version 1.7.2 ------
+
+2019-01-05 Mark Lindner <markl@avalon>
+
+ * lib/libconfig.c - fixed slow leak in config_destroy()
+ * <multiple> - miscellaenous build file fixes
+
+ ----- version 1.7.1 ------
+
+2017-11-15 Mark Lindner <markl@avalon>
+
+ * lib/wincompat.c, lib/wincompat.h - added fsync() implementation for
+ Windows
+ * lib/libconfig.c, lib/libconfig.h - added CONFIG_OPTION_FSYNC
+ * lib/libconfigcpp.c++, lib/libconfig.h++ - added Config::OptionFsync
+ * doc/libconfig.texi - Documentation updates
+
+2017-11-14 Mark Lindner <markl@avalon>
+
+ * lib/strbuf.c - bugfix in strbuf_append_char()
+
+ ----- version 1.7 ------
+
+2017-10-24 Mark Lindner <markl@avalon>
+
+ * INSTALL - Added information about installing from a git snapshot
+ * configure.ac - Bumped version to 1.7
+ * doc/libconfig.texi - Updated documentation, added new chapter on
+ libconfig bindings/implementations for other languages
+ * examples/c/Makefile.am, examples/c/example4.c, examples/c/example4.cfg,
+ examples/c/cfg_includes/*.cfg - New example program
+ * lib/Makefile.am - bumped library version to 11:0:0; added new source
+ files
+ * lib/grammar.c, lib/grammar.y, lib/scanner.c, lib/scanner.h - regenerated
+ * lib/grammar.y - allow optional trailing comma in lists and arrays
+ * *.vcproj - updated with new source files, library dependency
+ * lib/libconfig.c, lib/libconfig.h - various code cleanup;
+ reworked options API; moved some value parsing logic into lib/util.c
+ and lib/util.h; added new option
+ CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION; bugfix to disallow adding a
+ group or a list to an array; changed default float precision from 2 to 6;
+ fixed conversion between int and int64 types; added config_clear();
+ added support for include functions; added config_set_hook() and
+ config_get_hook()
+ * lib/libconfigcpp.c++, lib/libconfig.h++ - moved Option enum from Setting
+ to Config; added OptionAllowScientificNotation; added clear();
+ reworked options API; added evaluateIncludePath(); fixed casting to
+ unsigned int (don't clip negative values to 0)
+ * lib/parsectx.c, lib/parsectx.h - code cleanup
+ * lib/scanctx.c, lib/scanctx.h - added support for include functions;
+ code cleanup; removed non-portable directory reading code;
+ * lib/scanner.l - added support for include functions; moved some parsing
+ code to lib/util.c and lib/util.h; code cleanup
+ * lib/strbuf.c, lib/strbuf.h - added strbuf_append_char(); code cleanup
+ * lib/strvec.c, lib/strvec.h - new functions for managing arrays of
+ string pointers (for filename lists)
+ * lib/util.c, lib/util.h - value parsing and formatting code and memory
+ management macros and functions extracted from other files
+ * lib/wincompat.h - new macros for testing relative paths; replaced
+ INT32_MAX/INT32_MIN with INT_MAX/INT_MIN.
+ * tests/tests.c - fixed test failures and improper testing of int type
+ conversions
+
+ ----- version 1.6 ------
+
+2015-12-31 Jose Luis Tallon <jltallon@adv-solutions.net>
+
+ * Added include_dir feature (support for Debian-style conf.d/
+ includes) (pull request #36)
+
+ * Added octal_ints feature (support for integer expressed in octal,
+ useful for permissions and masks in UNIX-like systems (pull req #42)
+
+ * Fixed "Removing a setting removes all siblings" (issue #41)
+ Props random85
+
+ * Allow specifying the number of decimals wanted when outputting
+ Based upon a suggestion by zhaopingsun (issue #31)
+
+ * Make libconfig usable from CMake (pull request/issue #28)
+ Props thfi
+
+ * Documentation fixes
+ - Copyright and examples
+ - Included TeX patch from Debian (fixes FTBS with TeXlive)
+
+ * Resync Debian packaging
+ includes updated packages for GCC5 transition
+
+2015-10-14 Thomas Fischer <fischer@unix-ag.uni-kl.de>
+
+ * configure, configure.ac, debian/libconfig++9-dev.install,
+ debian/libconfig9-dev.install, lib/Makefile.am, lib/Makefile.in,
+ lib/libconfig++Config.cmake.in, lib/libconfigConfig.cmake.in,
+ libconfig.spec.in - locating libconfig in CMake-based projects
+
+2015-08-14 Mark Lindner <markl@neuromancer>
+
+ * lib/wincompat.h - Fixed Windows portability issue
+ * lib/libconfig.h++ - added missing operator[](std::string&).
+
+ ----- version 1.5 ------
+
+2015-05-16 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c - Don't fclose() a null pointer.
+
+2014-09-19 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c, lib/wincompat.h - check if file being opened is a
+ directory
+ * lib/libconfig.c, lib/libconfig.h, lib/libconfig.h++,
+ doc/libconfig.texi - added config_set_options(),
+ config_get_options(), setOptions(), getOptions().
+
+2014-05-25 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c++, lib/libconfig.h++ - added patches from Matt
+ Renaud (added iterators, removed throws() specifications); added
+ Setting.lookup(); code cleanup; added patch from Yuri Dyachenko
+ (made exception constructors public)
+ * lib/libconfig.c, lib/libconfig.h - renamed
+ config_setting_lookup_from() to config_setting_lookup() and
+ documented it; patch from Alexander Klauer (floating point precision
+ loss)
+ * doc/libconfig.texi - documented new APIs, bumped version
+ * lib/scanner.c, lib/scanner.h, lib/scanner.l, libconfig.c -
+ scanner code cleanup; and regenerated with flex 2.5.39
+ * lib/grammar.c, lib/grammar.h, lib/grammar.y - parser code cleanup;
+ and regenerated with bison 3.0.2
+ * README, ChangeLog - version updates
+
+2014-01-21 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c - bugfix; capture root filename
+ * tests/Makefile.am - fix for out-of-source builds
+ * ac_config.h.in, aclocal.m4 - updated to newer autotools
+
+ ----- version 1.4.9 ------
+
+2012-09-28 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfigcpp.c++ - Fixed compiler warnings in constructor
+ initializers
+ * tinytest/tiytest.c, tinytest/tinytest.h - added tt_file_exists();
+ added alternate implementations of some test macros since MSVC does
+ not support C99 fully; added comparators for text files (ignoring
+ line endings)
+ * tests/tests.c - use tt_file_exists() rather than access(); alias
+ snprintf to _snprintf for MSVC; compare files as text files rather
+ than as binary files
+ * lib/scanner.l - fixed parsing issue when backslash in string is
+ followed by invalid escape character; reported by Jimmy Scott
+ * lib/scanner.c - regenerated
+ * lib/libconfig.h, lib/libconfig.h++, lib/Makefile.am,
+ doc/libconfig.texi, configure.ac - bump version numbers
+ * aclocal.m4, ac_config.h - regenerated
+ * m4/*, aux-build/*, libtool - updated to newer
+
+2011-12-30 Mark Lindner <markl@neuromancer>
+
+ * debian/control - updates from Jonathan McCrohan
+
+ ----- version 1.4.8 ------
+
+2011-08-04 Mark Lindner <markl@neuromancer>
+
+ * tests/Makefile.am - marked 'libconfig_tests' as non-installable
+ * lib/scanner.l, lib/grammar.y - grammar changes to make trailing
+ semicolons optional (and to allow commas as an alternative)
+ * lib/libconfig.c - bugfixes for lack of auto-conversion handling in
+ the config_lookup*() functions (reported by Feng Yu), and some
+ fixes for compiler warnings
+ * lib/Makefile.am - bump .so version
+ * configure.ac - bump version, add '-Wno-unused-parameter' compiler
+ switch to disable "unused parameter" warnings
+ * doc/libconfig.texi - documentation updates; added a chapter that
+ calls attention to the bundled example programs
+ * lib/libconfig.h, lib/libconfig.h++ - bump versions
+
+ ----- version 1.4.7 ------
+
+2011-03-11 Mark Lindner <markl@neuromancer>
+
+ * doc/libconfig.texi - fixed typo; updated docs
+ * TODO - updated list
+ * lib/libconfig.c, lib/libconfig.h, lib/libconfigcpp.c++,
+ lib/libconfig.h++ - added config{get,set}_default_format(),
+ Config::{get,set}DefaultFormat()
+
+2011-03-10 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c - fixed memory leak when encountering a parse error
+ in an @include'd file
+ * lib/libconfig.h, lib/libconfig.h++, lib/Makefile.am, configure.ac,
+ doc/libconfig.texi - bump versions
+
+ ----- version 1.4.6 ------
+
+2010-09-10 Mark Lindner <markl@neuromancer>
+
+ * doc/libconfig.texi - documentation updates
+ * lib/libconfig.c, lib/libconfigcpp.c++, lib/libconfig.h,
+ lib/libconfig.h++, lib/wincompat.h, lib/scanctx.c - added support
+ for specifying an include directory
+ * m4/* - added local m4 directory
+ * contrib/* - added user-contributed files
+
+2010-09-07 Mark Lindner <markl@neuromancer>
+
+ * lib/scanner.l - bugfix for parse error when there is a missing
+ newline at the end of the file
+ * lib/libconfig.h, lib/libconfig.h++, lib/Makefile.am - bump version
+ * tinytest/* - added a simple unit testing framework
+ * tests/* - added preliminary unit tests
+ * configure.ac, ac_config.h, ac_config.h.in, Makefile.am,
+ lib/Makefile.am, libtool, doc/libconfig.texi - bump versions/dates
+ * lib/grammar.h, lib/grammar.c - regenerated with newer version of
+ Bison
+ * lib/libconfig.c - bugfix: explicitly set starting line number to 1
+ when parsing from strings; otherwise line numbers reported in parse
+ errors are undefined
+
+ ----- version 1.4.5 ------
+
+2010-05-04 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.h, lib/libconfig.h++, lib/Makefile.am - bumped version
+ numbers; removed #include for <map> and added one for <exception>
+ * lib/libconfigcpp.c++ - bugfix: properly handle TypeInt64 in add() and
+ assertType()
+ * aux-build/*, ac_config.h, configure.ac, ac_config.h.in, libtool -
+ regenerated with newer autotools
+ * libconfig.c - added declaration of libconfig_yylex_init_extra() to
+ eliminate compiler warning
+ * scanner.l - added #define YY_NO_INPUT to prevent compiler warning
+ * libconfig.texi - Added example code for operator=()
+
+ ----- version 1.4.4 ------
+
+2010-04-12 Mark Lindner <markl@neuromancer>
+
+ * lib/Makefile.am - fixed shared library version info
+ * lib/libconfig.h++ - added Setting::c_str() method
+ * configure.ac, ac_config.h, libconfig.spec, lib/libconfig.h,
+ lib/libconfig.h++ - bump versions
+ * lib/wincompat.h - fixed MinGW build error
+ * doc/libconfig.texi - doc updates
+ * README - added MinGW info
+
+ ----- version 1.4.3 ------
+
+2010-02-13 Mark Lindner <markl@neuromancer>
+
+ * lib/scanner.l - bugfix for matching @include with preceding
+ whitespace
+
+ ----- version 1.4.2 ------
+
+2010-01-19 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfigcpp.c++, lib/libconfig.h++ - bugfix for crash; added
+ copy constructor for ParseException (from Frederic Heitzmann)
+ * lib/libconfig.h, lib/libconfig.h++, lib/Makefile.am,
+ ac_config.h, libconfig.spec, configure.ac - bump versions
+
+2010-01-09 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfigcpp.c++ - bugfix in ParseException constructor (from
+ Ilya Dogolazky)
+ * debian/* - more cleanup, and added debug rules (from Ilya Dogolazky)
+
+ ----- version 1.4.1 ------
+
+2009-12-31 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c - bugfix for crash; removed unnecessary buffer delete
+ in __config_read()
+ * examples/c/Makefile.am, examples/c++/Makefile.am - fixed build issue
+ * configure.ac, Makefile.am - Added `--disable-examples' configure
+ option
+ * configure.ac, lib/Makefile.am, libconfig.spec, ac_config.h - bumped
+ version numbers
+
+ ----- version 1.4 ------
+
+2009-10-24 Mark Lindner <markl@neuromancer>
+
+ * grammar.y, scanner.l - properly report @include errors
+ * exmaples/example4.cpp - new example added
+
+2009-10-14 Mark Lindner <markl@neuromancer>
+
+ * debian/* - more fixes; from Klaus Schneider-Zapp
+ * libconfig.c - when writing strings, escape only control characters
+ with \x
+
+ ----- version 1.4b4 ------
+
+2009-09-09 Mark Lindner <markl@neuromancer>
+
+ * lib/Makefile.am - fixed MinGW build issues
+
+ ----- version 1.4b3 ------
+
+2009-09-04 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c, lib/scanner.l, lib/grammar.y - fixed all memory
+ leaks reported by Valgrind; removed an unncessary strdup()/free().
+
+2009-09-01 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c, lib/libconfig.h, lib/libconfigcpp.c++,
+ lib/libconfig.h++ - added config_error_type() and fixed a segfault
+ when throwing a ParseException.
+ * doc/libconfig.texi - doc updates
+
+ ----- version 1.4b2 ------
+
+2009-08-29 Mark Lindner <markl@neuromancer>
+
+ * examples/* - added new example programs to replace the less
+ practical ones in samples/
+
+2009-08-25 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c, lib/libconfig.h, lib/libconfigcpp.c++,
+ lib/libconfig.h++ - added config_set_tab_width(),
+ config_get_tab_width() and Config::setTabWidth(),
+ Config::getTabWidth().
+ * doc/libconfig.texi - doc updates
+
+ ----- version 1.4b1 ------
+
+2009-08-21 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.h++, lib/libconfigcpp.c++ - broke the public
+ dependency on libconfig.h; updated VC++ projects on Windows so that
+ the C++ DLL no longer exports any of the C API functions
+ * debian/* - updated for version 1.4
+ * lib/libconfig.c - fixed an isprint() assertion on Windows
+
+2009-08-20 Mark Lindner <markl@neuromancer>
+
+ * lib/parsectx.c, lib/parsectx.h, lib/scanctx.c, lib/scanctx.h,
+ lib/strbuf.c, lib/strbuf.h - code refactoring to reduce library size
+ lib/Makefile.am - fixed 'make install' error
+
+ ----- version 1.4b ------
+
+2009-08-16 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c, lib/libconfig.h, lib/scanctx.c, lib/scanctx.h,
+ lib/grammar.y, lib/grammar.c, lib/grammar.h - added
+ config_read_string(); added config_setting_source_file() and
+ management of list of input file names; added #ifdef guard for
+ DllMain() function so that it's not included for static library
+ builds
+ * lib/libconfigcpp.c++, lib/libconfig.h++ - added filename to
+ ParseException; bugfix in Setting::setFormat(); made what() methods
+ of exceptions public; added Setting::getSourceFile(),
+ Config::readString().
+ * doc/libconfig.texi - documentation updates
+ * lib/Makefile.am - bump .so version
+ * ac_config.h, configure.ac, libtool - bump version
+
+2009-07-19 Mark Lindner <markl@neuromancer>
+
+ * lib/libconfig.c, lib/libconfig.h, lib/libconfigcpp.c++,
+ lib/libconfig.h++ - added config_read_string() and
+ Config::readString() functions (contributed by Matthias Weisser).
+
+2009-07-02 Mark Lindner <markl@neuromancer>
+
+ * lib/parsectx.c, lib/parsectx.h, lib/scanctx.c, lib/scanctx.h,
+ lib/scanner.l, lib/grammar.y, lib/private.h, lib/Makefile.am,
+ lib/libconfig.c, lib/libconfig.h - replaced ugly C code in scanner.l
+ for processing strings with a new <STRING> scanner state and
+ associated rules; added support for hex character literals (\xNN) in
+ strings; refactored scanner and parser context into separate source
+ files; added preliminary support for include files ("@include"
+ directive).
+
+2009-05-27 Mark Lindner <markl@neuromancer>
+
+ * ltmain.sh, ac_config.h, ac_config.h.in, configure.ac, libconfig.spec,
+ libtool - upgraded to newer versions of autotools
+ * grammar.y, grammar.h, grammar.c, libconfigcpp.c++, libconfig.h++,
+ libconfig.c, libconfig.h - added LIBCONFIG_VER_* macros, changed API
+ to replace 'long' and 'unsigned long' with 'int' and 'unsigned int'
+ to resolve a portability problem; added 'const' to declarations of
+ getLine() and getError() methods on ParseException
+ * <multiple> - directory structure reorg
+
+ ----- version 1.3.2 ------
+
+2009-02-18 Mark Lindner <markl@neuromancer>
+
+ * libconfig.vcproj, libconfig++.vcproj - #define _STDLIB_H to
+ eliminate 'inconsistent dll linkage' warnings for free & malloc
+
+2009-02-17 Mark Lindner <markl@neuromancer>
+
+ * libconfig.c, libconfig.h - added config_setting_lookup*() functions;
+ modified config_lookup_*() functions to have more consistent API
+ (return status, and accept value-result param)
+ * debian/* - updates and cleanup (from Klaus Schneider-Zapp)
+ * libconfig.spec, Makefile.am, ac_config.h - update version number
+ * doc/libconfig.texi - documentation updates
+ * samples/c/sample1.c - patch from Rodolfo Giometti
+ * samples/c/stub.c - fixed relative to API changes
+
+2008-12-06 Mark Lindner <markl@neuromancer>
+
+ * libconfig.c - fix memory leak in config_setting_remove_elem();
+ reported by Timi Tuohenmaa
+ * configure.ac - fix incorrect processing of --enable-cxx option;
+ reported by Thomas Gazzola
+
+2008-09-11 Mark Lindner <markl@neuromancer>
+
+ * debian/libconfigduo2.postinst - fix typo in test stmt
+
+ ----- version 1.3.1 ------
+
+2008-09-07 Mark Lindner <markl@neuromancer>
+
+ * scanner.l, wincompat.h - workarounds for problems with parsing and
+ formatting of 64-bit integers on MinGW
+ * scanner.c - regenerated
+
+2008-09-05 Mark Lindner <markl@neuromancer>
+
+ * libconfig.spec - updated for 1.3.1
+ * Makefile.am - fix version
+ * scanner.l - add fromhex() function, since strtoull() seems broken
+ on MinGW
+
+2008-08-25 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++, libconfig.h++ - derive exceptions from
+ std::exception
+
+2008-08-10 Mark Lindner <markl@neuromancer>
+
+ * wincompat.h - fix MinGW build issue
+ * configure.ac, ac_config.h, Makefile.am - bump version
+ * doc/libconfig.texi - doc updates
+ * libconfigcpp.c++, libconfig.h++ - include path information in
+ setting exceptions
+ * libconfig.c - force "C" locale for parsing & formatting
+
+ ----- version 1.3 ------
+
+2008-04-07 Mark Lindner <markl@neuromancer>
+
+ * libconfig.spec - updated for 1.3
+
+2008-04-03 Mark Lindner <markl@neuromancer>
+
+ * scanner.l, grammar.y, libconfig.c, libconfig.h, wincompat.h -
+ fix/add comment headers, add C90 portability fixes from
+ Chris Pickett (C-style comments, renamed 'index' to 'idx' to
+ resolve name clash)
+ * scanner.c, grammar.c - regenerated
+ * configure.ac - enable more gcc warnings
+ * libconfigcpp.c++, libconfig.h++ - added getPath(), fixed impl of
+ isRoot(), add portability fixes from Chris Pickett (renamed 'index'
+ to 'idx' to resolve name clash), moved exception constructors into
+ source file; changed SettingExistsException to SettingNameException
+ to be more broad in scope
+ * Makefile.am - add wincompat.h to sources; add missing debian files
+ to EXTRA_DIST
+ * test.cfg - added example 64-bit integer settings
+ * samples/* - expanded some examples
+ * doc/libconfig.texi - documentation updates
+ * Makefile.am, *msvc7* - added (generated) VS2003 projects/solution
+
+2008-03-22 Mark Lindner <markl@neuromancer>
+
+ * debian/* - updates from Klaus Schneider
+
+2008-03-22 Mark Lindner <markl@neuromancer>
+
+ * scanner.l, grammar.y, libconfig.h++, libconfig.c, libconfig.h,
+ wincompat.h, libconfigcpp.c++, grammar.c, scanner.c, grammar.h -
+ add support for 64-bit integer values
+ * libconfig.texi - documentation updates
+ * Makefile.am, ac_config.h, configure.ac, libtool - bump version
+ * libconfig.h - add config_setting_parent(), config_setting_is_root()
+ * libconfigcpp.c++, libconfig.h++ - add isRoot(), getParent() to
+ Setting
+
+2008-03-15 Mark Lindner <markl@neuromancer>
+
+ * scanner.l - made 'true' and 'false' tokens completely
+ case-insensitive
+ * libconfigcpp.cc, libconfig.hh - added alias files for Windows
+ * libconfig.c, libconfig.h - modified __config_write_value() to write
+ out floating point values in a more human-readable form; added name
+ validation; added config_setting_remove_elem() and
+ config_setting_index()
+ * libconfigcpp.c++, libconfig.h++ - added remove(unsigned int) and
+ getIndex() to Setting
+ * libconfig.texi - documentation updates
+
+ ----- version 1.2.1 ------
+
+2007-12-21 Mark Lindner <markl@neuromancer>
+
+ * libconfig.c - source cleanup
+ * config.guess, config.sub, ltmain.sh, libtool - updated to newer
+ * configure.ac, Makefile.am, ac_config.h.in, ac_config.h
+ - MinGW-related fixes
+
+ ----- version 1.2 ------
+
+2007-10-15 Mark Lindner <markl@neuromancer>
+
+ * libconfig.h++, libconfigcpp.c++ - renamed "SettingFormat" to
+ "Setting::Format" to reduce namespace pollution
+
+2007-10-13 Mark Lindner <markl@neuromancer>
+
+ * scanner.l - updated regexp for float to allow for values which have
+ an exponent but no decimal point
+ * grammar.y - capture input line number when parsing settings
+ * libconfig.c, libconfig.h - added config_setting_is*() macros;
+ added config_setting_source_line(); added line member to
+ config_setting_t struct
+ * libconfig.c++, libconfig.h++ - renamed "SettingType" enum to
+ Setting::Type to reduce namespace pollution; added getSourceLine()
+ * samples/* - various updates
+ * debian/changelog - added entry
+ * ac_config.h, configure.ac, libtool, Makefile.am - new version #
+ * TODO - updates
+ * doc/libconfig.texi - documentation updates
+
+2007-10-12 Mark Lindner <markl@neuromancer>
+
+ * libconfig.c, libconfig.h - added config_set_auto_convert(),
+ config_get_auto_convert(), and number auto-conversion logic
+ * libconfigcpp.c++, libconfig.h++ - add setAutoConvert(),
+ getAutoConvert(), lookupValue() that takes std::string&,
+ corrected return values of assignment operators
+ * debian/rules - made file executable
+ * debian/libconfigduo-dev.install - add pkgconfig files to list
+
+2007-09-22 Mark Lindner <markl@neuromancer>
+
+ * libconfig.c, libconfig.h - change 'type' and 'format' members of
+ config_setting_t to short, thereby saving 4 bytes
+
+2007-09-22 Mark Lindner <markl@neuromancer>
+
+ * doc/libconfig.texi - add @direntry to fix install-info warnings
+ * libconfig.spec.in, Makefile.am, configure.ac - added RPM support
+ (from Deneys S. Maartens)
+
+2007-09-18 Mark Lindner <markl@neuromancer>
+
+ * libconfig.h - remove DLL_EXPORT; add LIBCONFIG_STATIC to fix
+ static linking on Windows
+
+2007-09-18 Deneys S. Maartens <dsm@tlabs.ac.za>
+
+ * samples/c/Makefile.am, samples/c++/Makefile.am - Add
+ AM_CPPFLAGS to fix distcheck build failure
+ * Makefile.am - expand wildcards in EXTRA_DIST to fix distcheck
+ build failure
+
+ ----- version 1.1.3 ------
+
+2007-08-03 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++ - bugfix in unsigned cast operators (incorrect value
+ clipping logic)
+ * debian/control - made some corrections
+
+ ----- version 1.1.2 ------
+
+2007-07-01 Mark Lindner <markl@neuromancer>
+
+ * debian/* added debian package files from Klaus Schneider
+ * libconfig.h++ - added new predicate is<type>() functions
+ * libconfig.h - fix comments
+ * doc/libconfig.texi - documentation updates
+ * ac_config.h, configure.ac, Makefile.am - new version #
+
+ ----- version 1.1.1 ------
+
+2007-06-15 Mark Lindner <markl@neuromancer>
+
+ * scanner.l - bugfix in string parsing
+ * test.cfg - added test case
+
+ ----- version 1.1 ------
+
+2007-04-18 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++ - bugfix in add(SettingType)
+ * stubcpp.cpp - add more ad-hoc tests
+
+2007-04-05 Mark Lindner <markl@neuromancer>
+
+ * scanner.l - Add string concatenation patch from Glenn Herteg.
+ Add \f as a whitespace character.
+ * grammar.y - add mode directive emacs
+ * libconfigcpp.c++, libconfig.h++ - add exists() and lookupValue()
+ methods; add Setting::operator std::string()
+ * libconfig.texi - documentation updates
+
+ ----- version 1.0.1 ------
+
+2006-11-26 Mark Lindner <markl@neuromancer>
+
+ * samples/c/Makefile.am, samples/c++/Makefile.am - fix linker error
+ * libconfig.texi - documentation update
+
+ ----- version 1.0 ------
+
+2006-10-19 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++ - bugfix in add() for lists
+
+2006-10-11 Mark Lindner <markl@neuromancer>
+
+ * scanner.l - allow asterisk in setting names (submitted by
+ James McCann)
+ * libconfig.texi - documentation updates
+ * configure.ac, Makefile.am, samples/Makefile.am - add --disable-cxx
+ configure option; conditionally build/install C++ components
+
+2006-10-01 Mark Lindner <markl@neuromancer>
+
+ * <multiple> - samples cleanup
+
+2006-09-14 Mark Lindner <markl@neuromancer>
+
+ * libconfig.c - Change %.8f to %e for double values in
+ __config_write_value(). Submitted by Filipe Maia.
+
+2006-08-31 Mark Lindner <markl@neuromancer>
+
+ * Makefile.am - changed bin_PROGRAMS to noinst_PROGRAMS; the stub
+ programs are for testing and should not be installed.
+
+2006-08-26 Mark Lindner <markl@neuromancer>
+
+ * libconfig.texi - documentation corrections & updates
+ * stub.c, stubcpp.c++ - check return value of fopen(); fix compiler
+ warnings
+ * configure.ac, Makefile.am - add -Wall to CFLAGS only for gcc;
+ add test.cfg to EXTRA_DIST
+ * grammar.y, libconfigcpp.c++ - fix compiler warnings
+ * libconfig.c - use CONFIG_TRUE & CONFIG_FALSE rather than 1 & 0
+ for success/failure return values.
+
+ ----- version 0.9 ------
+
+2006-07-29 Mark Lindner <markl@neuromancer>
+
+ * <multiple> - major grammar redesign: groups are now values instead of
+ distinct syntax constructs; this allows groups to be elements of
+ lists
+ * libconfig.texi - documentation updates; added new chapter containing
+ the BNF grammar
+ * test.cfg - modified to reflect new syntax and to demonstrate lists
+
+2006-06-23 Mark Lindner <markl@neuromancer>
+
+ * <multiple> - added support for lists (collections of
+ heterogeneous values of any type)
+ * libconfig.c - pretty-printing fixes in config_write()
+
+2006-06-08 Mark Lindner <markl@neuromancer>
+
+ * libconfig.h++ - added private copy constructor & assignment operator
+ (from Josef Meile)
+ * ligconfigcpp.c++, libconfig.h++ - added cast operators for unsigned
+ int and unsigned long (from Scott Frazer)
+ * <multiple> - add support for value formats; the only non-default
+ format currently supported is hexadecimal format for integer values
+ (based on patch from Scott Frazer)
+
+2006-04-15 Mark Lindner <markl@neuromancer>
+
+ * <multiple> - added pkg-config support
+
+2006-03-31 mlindner <markl@neuromancer>
+
+ * <multiple> - cleaned up config.tab.h mess (this file was obsolete,
+ and superseded by grammar.h ... problem identified by Scott Frazer)
+
+2006-03-30 mlindner <mlindner@chimera>
+
+ * grammar.y - fixed includes for windows (missing decl of malloc/free)
+ * libconfig.c - fixed several signed/unsigned warnings
+ * doc/libconfig.texi - documentation updates, formatting fix
+ * scanner.l - allow lowercase 'true' and 'false' in addition to
+ 'TRUE' and 'FALSE'
+
+2006-03-27 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++ - added missing break statements in switch (from
+ Lukas Zweifel)
+ * libconfig.c - don't strdup() a NULL string (from Lukas Zweifel)
+ * grammar.c, grammar.h - regenerated with bison 2.1
+
+2006-03-20 Mark Lindner <markl@neuromancer>
+
+ * scanner.l - added '%option nounistd' and regenerated with newest
+ version of flex; Windows doesn't have unistd.h.
+
+2006-03-17 Mark Lindner <markl@neuromancer>
+
+ * grammar.y - bugfix; error & abort parsing if duplicate setting name
+ encountered (previously caused a crash ... reported by Tobias Witek)
+ * scanner.l - bugfix; multi-line C-style comments were causing line
+ number counting to be thrown off, because the newlines were being
+ "eaten"
+ * <multiple> - various fixes to support building of DLLs on Windows.
+
+2005-11-26 Mark Lindner <markl@neuromancer>
+
+ * grammar.y, scanner.l - always strdup() yytext, and free the memory
+ in the grammar rules.
+
+2005-11-22 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++, libconfig.h++, libconfig.c, libconfig.h -
+ Added Daniel's enhancements: methods & functions for reading/writing
+ files, fixes for various memory leaks, etc.
+ * samples/* - Added Daniel's example code.
+ * docs/libconfig.texi - Updated documentation
+
+2005-09-28 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++, libconfig.h++, libconfig.c, libconfig.h
+ Enhanced API to support modification of a configuration.
+ * libconfig.texi - updated manual
+
+2005-06-02 Mark Lindner <markl@neuromancer>
+
+ * libconfigcpp.c++, libconfig.h++ - Added getName() method;
+ fixed operator[](int) to work with groups; this allows iteration over
+ a group's child settings. Added a missing break statement (bugfix
+ submitted by Pablo Barrera Gonzalez). Added operator int() and
+ operator float() to Setting; note that these may cause loss of
+ precision since the actual values are stored internally as long
+ and double, respectively.
+
+ * libconfig.h - added config_setting_name() macro
+
+ * libconfig.c - maintain two lists of children at each node; a sorted
+ list and an unsorted list (to preserve the order of the settings as
+ they appear in the file).
+
+ * scanner.l - fixed scanner rule for comments. '#' no longer has to
+ be in column 0 to be recognized as a comment. Added support for C
+ and C++ style comments.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..7958936
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,255 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Installation from Cloned Git Repository
+=======================================
+
+If you obtained the package by cloning the git repository, there are some
+additional steps required to build the package, as the generated 'configure'
+script and other supporting build files are not included in the repository.
+
+You must have the GNU autotools installed:
+
+- autoconf (version 2.69 or newer recommended)
+- automake (version 1.15 or newer recommended)
+- libtool (version 2.4.6 or newer recommended)
+
+If you plan to modify the source code, you may also need the following:
+
+- GNU Bison (verison 3.0.4 or newer required)
+- flex (version 2.6.4 or newer required)
+
+Generate the 'configure' script and other necessary build files by running
+'autoreconf' in the toplevel libconfig directory.
+
+Then, follow the basic installation instructions below.
+
+Basic Installation
+==================
+
+These are generic installation instructions when building from a released
+distribution tarball.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PREFIX', the package will
+use PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..86cd459
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,504 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+(This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.)
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ {description}
+ Copyright (C) {year} {fullname}
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random
+ Hacker.
+
+ {signature of Ty Coon}, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it! \ No newline at end of file
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..80881a9
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,18 @@
+name: "libconfig"
+description:
+ "Libconfig is a simple library for processing structured configuration "
+ "files."
+
+third_party {
+ url {
+ type: HOMEPAGE
+ value: "https://hyperrealm.github.io/libconfig/"
+ }
+ url {
+ type: GIT
+ value: "https://github.com/hyperrealm/libconfig.git"
+ }
+ version: "v1.7.3"
+ last_upgrade_date { year: 2021 month: 7 day: 14 }
+ license_type: RESTRICTED
+}
diff --git a/MODULE_LICENSE_LGPL b/MODULE_LICENSE_LGPL
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_LGPL
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..684608d
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,49 @@
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = lib
+
+if BUILDDOC
+SUBDIRS += doc
+endif
+
+if BUILDEXAMPLES
+SUBDIRS += examples
+endif
+
+if BUILDTESTS
+SUBDIRS += tinytest tests
+endif
+
+.PHONY: dist-rpm
+
+dist-rpm: distcheck
+ rpmbuild -ta $(distdir).tar.gz
+
+EXTRA_DIST = \
+ m4/*.m4 \
+ *.sln \
+ test.cfg \
+ TODO \
+ debian/changelog \
+ debian/compat \
+ debian/control \
+ debian/copyright \
+ debian/docs \
+ debian/libconfig++9-dev.install \
+ debian/libconfig++9.install \
+ debian/libconfig9-dev.docs \
+ debian/libconfig9-dev.install \
+ debian/libconfig9.info \
+ debian/libconfig9.install \
+ debian/rules \
+ debian/shlibs \
+ debian/watch \
+ libconfig.spec \
+ contrib
+
+dist-hook:
+ rm -rf `find $(distdir)/contrib -name .svn`
+
+test:
+ cd tests && ./libconfig_tests
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..b9f5251
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,4 @@
+jeongik@google.com
+jaeman@google.com
+sundongahn@google.com
+jooyung@google.com
diff --git a/README b/README
new file mode 100644
index 0000000..5aef293
--- /dev/null
+++ b/README
@@ -0,0 +1,78 @@
+
+To produce a PDF manual, issue the command "make pdf" after running
+`./configure'.
+
+ -*-
+
+If you do not wish to build the C++ components, use:
+
+./configure --disable-cxx
+
+ -*-
+
+The `examples' subdirectory contains some examples of using libconfig
+from C and C++.
+
+ -*-
+
+Flex and Bison are not required in order to build this
+package. However, you will need them, if you modify the .l or .y files. See
+the list of required build tool versions below.
+
+ -*-
+
+To successfully compile using MinGW (with gcc 4.4.0 or later), it may
+be necessary to modify the file "mingw32\4.4.0\libstdc++.la", changing line 11
+from:
+
+library_names='libstdc++.dll.a'
+
+to:
+
+library_names='libstdc++.a'
+
+(See http://trac.osgeo.org/geos/ticket/282 for more information).
+
+ -*-
+
+To cross-compile for Android:
+
+1) Create a standalone toolchain using the 'make-standalone-toolchain.sh'
+script included with the Android NDK. For example:
+
+$ /pkg/android-ndk-r9d/build/tools/make-standalone-toolchain.sh \
+ --platform=android-19 \
+ --install-dir=/pkg/android-toolchain-19 \
+ --system=linux-x86_64 \
+ --arch=arm
+
+2) Add the standalone toolchain's bin directory to the front of the path:
+
+$ export PATH=/pkg/android-toolchain-19/bin:$PATH
+
+3) Configure libconfig for cross-compilation:
+
+$ ./configure --host=arm-linux-androideabi \
+ --with-sysroot=/pkg/android-toolchain-19/sysroot
+
+4) Build libconfig
+
+$ make
+
+ -*-
+
+Build tools dependencies. (These are only required if you are a maintainer.)
+
+Autoconf 2.69
+Automake 1.14.1
+Bison 3.0.2
+Flex 2.5.39
+Libtool 2.4.2
+
+ -*-
+
+Libconfig may be found on github at https://github.com/hyperrealm/libconfig
+
+
+
+For some reason, we need to symlink /pkg/android-toolchain-19/sysroot/pkg -> /pkg
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..097121e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,7 @@
+libconfig
+=========
+
+C/C++ library for processing structured configuration files.
+
+Visit the [libconfig project page](https://hyperrealm.github.io/libconfig/)
+for distribution tarballs and other info.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e63f3b3
--- /dev/null
+++ b/TODO
@@ -0,0 +1,39 @@
+TO-DOs:
+
+These are features that have been requested, and have been considered,
+but are not yet implemented, because I'm undecided about how or whether they
+should be implemented, and/or because they are difficult and/or time-consuming
+to implement.
+
+Also, some of these features tend to push libconfig toward becoming a
+general-purpose structured-data storage mechanism, which is really not the
+intended purpose of this library. I think something like sqlite is better
+suited for that sort of thing.
+
+
+* Add support for copying settings from one configuration to another. Need a
+ recursive function to copy a setting and call itself on all child settings.
+
+
+* Add a += operator, so that additional elements can be appended to a list or
+ array. The issue with this is defining a consistent syntax. For example:
+
+ x = ( 1, 2, 3 );
+ x += ( 4, 5 );
+
+ Should this result in ( 1, 2, 3, 4, 5 ), or ( 1, 2, 3, ( 4, 5 ))? I believe
+ it should be the latter. However, only the former makes sense for arrays.
+
+
+* Add the ability to insert/delete elements at any position in a list or
+ array. A simple implementation would be expensive (shift all the elements
+ by one for every insert/delete), and a more efficient implementation would
+ add a lot of complexity to the library.
+
+
+* Add limited support for preserving comments.
+
+
+* Add support for unicode strings? A bit problematic, since flex doesn't
+ support unicode input, AFAICT. But maybe supply convenience functions to
+ convert between parsed UTF-8 strings and std::wstring.
diff --git a/_config.yml b/_config.yml
new file mode 100644
index 0000000..c419263
--- /dev/null
+++ b/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-cayman \ No newline at end of file
diff --git a/ac_config.h.in b/ac_config.h.in
new file mode 100644
index 0000000..6244938
--- /dev/null
+++ b/ac_config.h.in
@@ -0,0 +1,116 @@
+/* ac_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `freelocale' function. */
+#undef HAVE_FREELOCALE
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `newlocale' function. */
+#undef HAVE_NEWLOCALE
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `uselocale' function. */
+#undef HAVE_USELOCALE
+
+/* Define to 1 if you have the <xlocale.h> header file. */
+#undef HAVE_XLOCALE_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Configured target name. */
+#undef TARGET
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
diff --git a/aux-build/compile b/aux-build/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/aux-build/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/aux-build/config.guess b/aux-build/config.guess
new file mode 100755
index 0000000..9afd676
--- /dev/null
+++ b/aux-build/config.guess
@@ -0,0 +1,1568 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-11-29'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+esac
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/aux-build/config.rpath b/aux-build/config.rpath
new file mode 100755
index 0000000..c547c68
--- /dev/null
+++ b/aux-build/config.rpath
@@ -0,0 +1,666 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2007 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix4* | aix5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ library_names_spec='$libname.a'
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd1*)
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_os" in
+ freebsd[123]*)
+ library_names_spec='$libname$shrext$versuffix' ;;
+ *)
+ library_names_spec='$libname$shrext' ;;
+ esac
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ nto-qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/aux-build/config.sub b/aux-build/config.sub
new file mode 100755
index 0000000..61cb4bc
--- /dev/null
+++ b/aux-build/config.sub
@@ -0,0 +1,1793 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-10-01'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 \
+ | or1k | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or1k-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/aux-build/depcomp b/aux-build/depcomp
new file mode 100755
index 0000000..4ebd5b3
--- /dev/null
+++ b/aux-build/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/aux-build/install-sh b/aux-build/install-sh
new file mode 100755
index 0000000..377bb86
--- /dev/null
+++ b/aux-build/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/aux-build/ltmain.sh b/aux-build/ltmain.sh
new file mode 100644
index 0000000..63ae69d
--- /dev/null
+++ b/aux-build/ltmain.sh
@@ -0,0 +1,9655 @@
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --no-warn don't display warning messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4.2
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.2
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$absdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/aux-build/missing b/aux-build/missing
new file mode 100755
index 0000000..db98974
--- /dev/null
+++ b/aux-build/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/aux-build/mkinstalldirs b/aux-build/mkinstalldirs
new file mode 100755
index 0000000..55d537f
--- /dev/null
+++ b/aux-build/mkinstalldirs
@@ -0,0 +1,162 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2009-04-28.21; # UTC
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+IFS=" "" $nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the 'mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because '.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/aux-build/test-driver b/aux-build/test-driver
new file mode 100755
index 0000000..d306056
--- /dev/null
+++ b/aux-build/test-driver
@@ -0,0 +1,139 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2013-07-13.22; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ estatus=1
+fi
+
+case $estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/aux-build/texinfo.tex b/aux-build/texinfo.tex
new file mode 100644
index 0000000..85f184c
--- /dev/null
+++ b/aux-build/texinfo.tex
@@ -0,0 +1,10079 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2013-02-01.11}
+%
+% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation, either version 3 of the
+% License, or (at your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexraggedright=\raggedright
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+\let\ptextop=\top
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined \gdef\putworderror{error}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+
+% Since the category of space is not known, we have to be careful.
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode`\ =\spacecat}
+
+% sometimes characters are active, so we need control sequences.
+\chardef\ampChar = `\&
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dashChar = `\-
+\chardef\dotChar = `\.
+\chardef\exclamChar= `\!
+\chardef\hashChar = `\#
+\chardef\lquoteChar= `\`
+\chardef\questChar = `\?
+\chardef\rquoteChar= `\'
+\chardef\semiChar = `\;
+\chardef\slashChar = `\/
+\chardef\underChar = `\_
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+ ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ spell-ing spell-ings
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt }
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines16
+}%
+
+% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+%
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Output a mark which sets \thischapter, \thissection and \thiscolor.
+% We dump everything together because we only have one kind of mark.
+% This works because we only use \botmark / \topmark, not \firstmark.
+%
+% A mark contains a subexpression of the \ifcase ... \fi construct.
+% \get*marks macros below extract the needed part using \ifcase.
+%
+% Another complication is to let the user choose whether \thischapter
+% (\thissection) refers to the chapter (section) in effect at the top
+% of a page, or that at the bottom of a page. The solution is
+% described on page 260 of The TeXbook. It involves outputting two
+% marks for the sectioning macros, one before the section break, and
+% one after. I won't pretend I can describe this better than DEK...
+\def\domark{%
+ \toks0=\expandafter{\lastchapterdefs}%
+ \toks2=\expandafter{\lastsectiondefs}%
+ \toks4=\expandafter{\prevchapterdefs}%
+ \toks6=\expandafter{\prevsectiondefs}%
+ \toks8=\expandafter{\lastcolordefs}%
+ \mark{%
+ \the\toks0 \the\toks2
+ \noexpand\or \the\toks4 \the\toks6
+ \noexpand\else \the\toks8
+ }%
+}
+% \topmark doesn't work for the very first chapter (after the title
+% page or the contents), so we use \firstmark there -- this gets us
+% the mark with the chapter defs, unless the user sneaks in, e.g.,
+% @setcolor (or @url, or @link, etc.) between @contents and the very
+% first @chapter.
+\def\gettopheadingmarks{%
+ \ifcase0\topmark\fi
+ \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
+}
+\def\getbottomheadingmarks{\ifcase1\botmark\fi}
+\def\getcolormarks{\ifcase2\topmark\fi}
+
+% Avoid "undefined control sequence" errors.
+\def\lastchapterdefs{}
+\def\lastsectiondefs{}
+\def\prevchapterdefs{}
+\def\prevsectiondefs{}
+\def\lastcolordefs{}
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ % We don't want .vr (or whatever) entries like this:
+ % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
+ % "\acronym" won't work when it's read back in;
+ % it needs to be
+ % {\code {{\tt \backslashcurfont }acronym}
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingyyy.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 24pt
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \indexdummies
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1\relax \unvbox#1\relax
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\argtorun{#2}%
+ \begingroup
+ \obeylines
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ \argremovecomment #1\comment\ArgTerm%
+ }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+% @end itemize @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \argtorun.
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
+
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick. --kasal, 16nov03
+
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+ \obeyspaces
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as environments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At run-time, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
+ \else
+ \badenverr
+ \fi
+}
+
+% Environment mismatch, #1 expected:
+\def\badenverr{%
+ \errhelp = \EMsimple
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ outside of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal.
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+ \def\temp{#1}%
+ \ifx\temp\onword \plainfrenchspacing
+ \else\ifx\temp\offword \plainnonfrenchspacing
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
+ \fi\fi
+}
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ \startsavinginserts
+ %
+ \setbox\groupbox = \vtop\bgroup
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\parseargdef\need{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change). This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% @include FILE -- \input text of FILE.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable % we want to expand any @value in FILE.
+ \turnoffactive % and allow special characters in the expansion
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @include of #1^^J}%
+ \edef\temp{\noexpand\input #1 }%
+ %
+ % This trickery is to read FILE outside of a group, in case it makes
+ % definitions, etc.
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \catcode`-=\other
+ \catcode`\`=\other
+ \catcode`\'=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
+%
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+ \ifhmode
+ \let\centersub\centerH
+ \else
+ \let\centersub\centerV
+ \fi
+ \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+ \let\centersub\relax % don't let the definition persist, just in case
+}
+\def\centerH#1{{%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+ % The idea here is the same as in \startdefun, \cartouche, etc.: if
+ % @center is the first thing after a section heading, we need to wipe
+ % out the negative parskip inserted by \sectionheading, but still
+ % prevent a page break here.
+ \centerpenalty = \lastpenalty
+ \ifnum\centerpenalty>10000 \vskip\parskip \fi
+ \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+ \line{\kern\leftskip #1\kern\rightskip}%
+}
+
+% @sp n outputs n lines of vertical space
+%
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+%
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+%
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \restorefirstparagraphindent
+ \indent
+ }%
+ \gdef\noindent{%
+ \restorefirstparagraphindent
+ \noindent
+ }%
+ \global\everypar = {%
+ \kern -\parindent
+ \restorefirstparagraphindent
+ }%
+}
+
+\gdef\restorefirstparagraphindent{%
+ \global \let \indent = \ptexindent
+ \global \let \noindent = \ptexnoindent
+ \global \everypar = {}%
+}
+
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \iflinks
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ \openin 1 texinfo.cnf
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets,
+% for display in the outlines, and in other places. Thus, we have to
+% double any backslashes. Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e. Not good.
+%
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages. The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+ \ifx\pdfescapestring\thisisundefined
+ % No primitive available; should we give a warning or log?
+ % Many times it won't matter.
+ \else
+ % The expandable \pdfescapestring primitive escapes parentheses,
+ % backslashes, and other special chars.
+ \xdef#1{\pdfescapestring{#1}}%
+ \fi
+}
+
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found. (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
+\ifpdf
+ %
+ % Color manipulation macros based on pdfcolor.tex,
+ % except using rgb instead of cmyk; the latter is said to render as a
+ % very dark gray on-screen and a very dark halftone in print, instead
+ % of actual black.
+ \def\rgbDarkRed{0.50 0.09 0.12}
+ \def\rgbBlack{0 0 0}
+ %
+ % k sets the color for filling (usual text, etc.);
+ % K sets the color for stroking (thin rules, e.g., normal _'s).
+ \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
+ %
+ % Set color, and create a mark which defines \thiscolor accordingly,
+ % so that \makeheadline knows which color to restore.
+ \def\setcolor#1{%
+ \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ }
+ %
+ \def\maincolor{\rgbBlack}
+ \pdfsetcolor{\maincolor}
+ \edef\thiscolor{\maincolor}
+ \def\lastcolordefs{}
+ %
+ \def\makefootline{%
+ \baselineskip24pt
+ \line{\pdfsetcolor{\maincolor}\the\footline}%
+ }
+ %
+ \def\makeheadline{%
+ \vbox to 0pt{%
+ \vskip-22.5pt
+ \line{%
+ \vbox to8.5pt{}%
+ % Extract \thiscolor definition from the marks.
+ \getcolormarks
+ % Typeset the headline with \maincolor, then restore the color.
+ \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+ }%
+ \vss
+ }%
+ \nointerlineskip
+ }
+ %
+ %
+ \pdfcatalog{/PageMode /UseOutlines}
+ %
+ % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+ \def\dopdfimage#1#2#3{%
+ \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+ % others). Let's try in that order, PDF first since if
+ % someone has a scalable image, presumably better to use that than a
+ % bitmap.
+ \let\pdfimgext=\empty
+ \begingroup
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \errhelp = \nopdfimagehelp
+ \errmessage{Could not find image file #1 for pdf}%
+ \else \gdef\pdfimgext{JPG}%
+ \fi
+ \else \gdef\pdfimgext{jpeg}%
+ \fi
+ \else \gdef\pdfimgext{jpg}%
+ \fi
+ \else \gdef\pdfimgext{png}%
+ \fi
+ \else \gdef\pdfimgext{PDF}%
+ \fi
+ \else \gdef\pdfimgext{pdf}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ % without \immediate, ancient pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifdim \wd0 >0pt width \pdfimagewidth \fi
+ \ifdim \wd2 >0pt height \pdfimageheight \fi
+ \ifnum\pdftexversion<13
+ #1.\pdfimgext
+ \else
+ {#1.\pdfimgext}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ %
+ \def\pdfmkdest#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \turnoffactive
+ \makevalueexpandable
+ \def\pdfdestname{#1}%
+ \txiescapepdf\pdfdestname
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }}
+ %
+ % used to mark target names; must be expandable.
+ \def\pdfmkpgn#1{#1}
+ %
+ % by default, use a color that is dark enough to print on paper as
+ % nearly black, but still distinguishable for online viewing.
+ \def\urlcolor{\rgbDarkRed}
+ \def\linkcolor{\rgbDarkRed}
+ \def\endlink{\setcolor{\maincolor}\pdfendlink}
+ %
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by 1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ %
+ % #1 is the section text, which is what will be displayed in the
+ % outline by the pdf viewer. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node text,
+ % which might be empty if this toc entry had no corresponding node.
+ % #4 is the page number
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worth the trouble, since most documents are normally structured.
+ \edef\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty
+ \def\pdfoutlinedest{#4}%
+ \else
+ \txiescapepdf\pdfoutlinedest
+ \fi
+ %
+ % Also escape PDF chars in the display string.
+ \edef\pdfoutlinetext{#1}%
+ \txiescapepdf\pdfoutlinetext
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\partentry##1##2##3##4{}% ignore parts in the outlines
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \def\thischapnum{0}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ \readdatafile{toc}%
+ %
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
+ %
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % TODO this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Too
+ % much work for too little return. Just use the ASCII equivalents
+ % we use for the index sort strings.
+ %
+ \indexnofonts
+ \setupdatafile
+ % We can have normal brace characters in the PDF outlines, unlike
+ % Texinfo index files. So set that up.
+ \def\{{\lbracecharliteral}%
+ \def\}{\rbracecharliteral}%
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+ {\catcode`[=1 \catcode`]=2
+ \catcode`{=\other \catcode`}=\other
+ \gdef\lbracecharliteral[{]%
+ \gdef\rbracecharliteral[}]%
+ ]
+ %
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \nextsp}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ % do we want to go so far as to use \indexnofonts instead of just
+ % special-casing \var here?
+ \def\var##1{##1}%
+ %
+ \leavevmode\setcolor{\urlcolor}%
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \setcolor{\linkcolor}#1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+ % non-pdf mode
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\setcolor = \gobble
+ \let\pdfsetcolor = \gobble
+ \let\pdfmakeoutlines = \relax
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Unfortunately, we have to override this for titles and the like, since
+% in those cases "rm" is bold. Sigh.
+\def\rmisbold{\rm\def\curfontstyle{bf}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+% can get a sort of poor man's double spacing by redefining this.
+\def\baselinefactor{1}
+%
+\newdimen\textleading
+\def\setleading#1{%
+ \dimen0 = #1\relax
+ \normalbaselineskip = \baselinefactor\dimen0
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% PDF CMaps. See also LaTeX's t1.cmap.
+%
+% do nothing with this by default.
+\expandafter\let\csname cmapOT1\endcsname\gobble
+\expandafter\let\csname cmapOT1IT\endcsname\gobble
+\expandafter\let\csname cmapOT1TT\endcsname\gobble
+
+% if we are producing pdf, and we have \pdffontattr, then define cmaps.
+% (\pdffontattr was introduced many years ago, but people still run
+% older pdftex's; it's easy to conditionalize, so we do.)
+\ifpdf \ifx\pdffontattr\thisisundefined \else
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1-0)
+%%Title: (TeX-OT1-0 TeX OT1 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+40 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1IT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1IT-0)
+%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1IT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1IT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<25> <26> <0025>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+42 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<23> <0023>
+<24> <00A3>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1IT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1TT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1TT-0)
+%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1TT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1TT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+5 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<21> <26> <0021>
+<28> <5F> <0028>
+<61> <7E> <0061>
+endbfrange
+32 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <2191>
+<0C> <2193>
+<0D> <0027>
+<0E> <00A1>
+<0F> <00BF>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<20> <2423>
+<27> <2019>
+<60> <2018>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1TT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+\fi\fi
+
+
+% Set the font macro #1 to the font named \fontprefix#2.
+% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
+\def\setfont#1#2#3#4#5{%
+ \font#1=\fontprefix#2#3 scaled #4
+ \csname cmap#5\endcsname#1%
+}
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+%
+% (end of cmaps)
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\thisisundefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} % where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Definitions for a main text size of 11pt. (The default in Texinfo.)
+%
+\def\definetextfontsizexi{%
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1095}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}{OT1}
+\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
+\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
+\setfont\chapsf\sfbshape{17}{1000}{OT1}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+\def\chapecsize{1728}
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep2}{OT1}
+\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}{OT1}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+\def\sececsize{1440}
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
+\setfont\ssecit\itbshape{10}{1315}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1315}{OT1}
+\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}{OT1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+\def\ssececsize{1200}
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}{OT1}
+\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{1000}{OT1}
+\setfont\reducedit\itshape{10}{1000}{OT1IT}
+\setfont\reducedsl\slshape{10}{1000}{OT1}
+\setfont\reducedsf\sfshape{10}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{1000}{OT1}
+\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+\def\reducedecsize{1000}
+
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts % reset the current fonts
+\rm
+} % end of 11pt text font size definitions, \definetextfontsizexi
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit. This is for the GNU
+% Press printing of the Emacs 22 manual. Maybe other manuals in the
+% future. Used with @smallbook, which sets the leading to 12pt.
+%
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1000}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
+\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
+\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+\def\chapecsize{1440}
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}{OT1}
+\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep1}{OT1}
+\setfont\sectt\ttbshape{12}{1000}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
+\setfont\secsf\sfbshape{12}{1000}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}{OT1}
+\font\seci=cmmi12
+\font\secsy=cmsy10 scaled \magstep1
+\def\sececsize{1200}
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}{OT1}
+\setfont\ssecit\itbshape{10}{1000}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1000}{OT1}
+\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
+\setfont\ssecsf\sfbshape{10}{1000}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}{OT1}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+\def\ssececsize{1000}
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}{OT1}
+\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{900}{OT1}
+\setfont\reducedit\itshape{9}{1000}{OT1IT}
+\setfont\reducedsl\slshape{9}{1000}{OT1}
+\setfont\reducedsf\sfshape{9}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{900}{OT1}
+\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+\def\reducedecsize{0900}
+
+\divide\parskip by 2 % reduce space between paragraphs
+\textleading = 12pt % line spacing for 10pt CM
+\textfonts % reset the current fonts
+\rm
+} % end of 10pt text font size definitions, \definetextfontsizex
+
+
+% We provide the user-level command
+% @fonttextsize 10
+% (or 11) to redefine the text font size. pt is assumed.
+%
+\def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
+%
+\parseargdef\fonttextsize{%
+ \def\textsizearg{#1}%
+ %\wlog{doing @fonttextsize \textsizearg}%
+ %
+ % Set \globaldefs so that documents can use this inside @tex, since
+ % makeinfo 4.8 does not support it, but we need it nonetheless.
+ %
+ \begingroup \globaldefs=1
+ \ifx\textsizearg\xword \definetextfontsizex
+ \else \ifx\textsizearg\xiword \definetextfontsizexi
+ \else
+ \errhelp=\EMsimple
+ \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+ \fi\fi
+ \endgroup
+}
+
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+ \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+ \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\curfontsize{text}%
+ \def\lsize{reduced}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \def\curfontsize{title}%
+ \def\lsize{chap}\def\lllsize{subsec}%
+ \resetmathfonts \setleading{27pt}}
+\def\titlefont#1{{\titlefonts\rmisbold #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+ \let\tenttsl=\chapttsl
+ \def\curfontsize{chap}%
+ \def\lsize{sec}\def\lllsize{text}%
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\curfontsize{sec}%
+ \def\lsize{subsec}\def\lllsize{reduced}%
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\curfontsize{ssec}%
+ \def\lsize{text}\def\lllsize{small}%
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\curfontsize{reduced}%
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \def\curfontsize{small}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+ \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+ \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+ \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+ \let\tenttsl=\smallerttsl
+ \def\curfontsize{smaller}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{9.5pt}}
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
+% Define these just so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+% --karl, 24jan03.
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\definetextfontsizexi
+
+
+\message{markup,}
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
+% define and register \INITMACRO to be called on markup style changes.
+% \INITMACRO can check \currentmarkupstyle for the innermost
+% style and the set of \ifmarkupSTYLE switches for all styles
+% currently in effect.
+\newif\ifmarkupvar
+\newif\ifmarkupsamp
+\newif\ifmarkupkey
+%\newif\ifmarkupfile % @file == @samp.
+%\newif\ifmarkupoption % @option == @samp.
+\newif\ifmarkupcode
+\newif\ifmarkupkbd
+%\newif\ifmarkupenv % @env == @code.
+%\newif\ifmarkupcommand % @command == @code.
+\newif\ifmarkuptex % @tex (and part of @math, for now).
+\newif\ifmarkupexample
+\newif\ifmarkupverb
+\newif\ifmarkupverbatim
+
+\let\currentmarkupstyle\empty
+
+\def\setupmarkupstyle#1{%
+ \csname markup#1true\endcsname
+ \def\currentmarkupstyle{#1}%
+ \markupstylesetup
+}
+
+\let\markupstylesetup\empty
+
+\def\defmarkupstylesetup#1{%
+ \expandafter\def\expandafter\markupstylesetup
+ \expandafter{\markupstylesetup #1}%
+ \def#1%
+}
+
+% Markup style setup for left and right quotes.
+\defmarkupstylesetup\markupsetuplq{%
+ \expandafter\let\expandafter \temp
+ \csname markupsetuplq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
+}
+
+\defmarkupstylesetup\markupsetuprq{%
+ \expandafter\let\expandafter \temp
+ \csname markupsetuprq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
+}
+
+{
+\catcode`\'=\active
+\catcode`\`=\active
+
+\gdef\markupsetuplqdefault{\let`\lq}
+\gdef\markupsetuprqdefault{\let'\rq}
+
+\gdef\markupsetcodequoteleft{\let`\codequoteleft}
+\gdef\markupsetcodequoteright{\let'\codequoteright}
+}
+
+\let\markupsetuplqcode \markupsetcodequoteleft
+\let\markupsetuprqcode \markupsetcodequoteright
+%
+\let\markupsetuplqexample \markupsetcodequoteleft
+\let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqkbd \markupsetcodequoteleft
+\let\markupsetuprqkbd \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
+\let\markupsetuplqverb \markupsetcodequoteleft
+\let\markupsetuprqverb \markupsetcodequoteright
+%
+\let\markupsetuplqverbatim \markupsetcodequoteleft
+\let\markupsetuprqverbatim \markupsetcodequoteright
+
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report. xpdf does work with the regular 0x27.
+%
+\def\codequoteright{%
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
+ \else \char'15 \fi
+}
+%
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+%
+\def\codequoteleft{%
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ % [Knuth] pp. 380,381,391
+ % \relax disables Spanish ligatures ?` and !` of \tt font.
+ \relax`%
+ \else \char'22 \fi
+ \else \char'22 \fi
+}
+
+% Commands to set the quote options.
+%
+\parseargdef\codequoteundirected{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequoteundirected\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+ \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = t%
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxicodequotebacktick\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+ \fi\fi
+}
+
+% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
+\def\noligaturesquoteleft{\relax\lq}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Font commands.
+
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+ \ifusingtt
+ {{\ttsl #2}\let\next=\relax}%
+ {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+ \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
+
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+ \ifx\next,%
+ \else\ifx\next-%
+ \else\ifx\next.%
+ \else\ptexslash
+ \fi\fi\fi
+ \aftersmartic
+}
+
+% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
+\def\ttslanted#1{{\ttsl #1}}
+
+% @cite is like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+ \let\saveaftersmartic = \aftersmartic
+ \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+ \smartslanted{#1}%
+}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @b, explicit bold. Also @strong.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\plainfrenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ \def\endofsentencespacefactor{1000}% for @. and friends
+ }
+ \def\plainnonfrenchspacing{%
+ \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+ \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+ \def\endofsentencespacefactor{3000}% for @. and friends
+ }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+% @t, explicit typewriter.
+\def\t#1{%
+ {\tt \rawbackslash \plainfrenchspacing #1}%
+ \null
+}
+
+% @samp.
+\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
+
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \plainfrenchspacing
+ #1%
+ }%
+ \null % reset spacefactor to 1000
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+%
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active \catcode`\_=\active
+ \catcode`\'=\active \catcode`\`=\active
+ \global\let'=\rq \global\let`=\lq % default definitions
+ %
+ \global\def\code{\begingroup
+ \setupmarkupstyle{code}%
+ % The following should really be moved into \setupmarkupstyle handlers.
+ \catcode\dashChar=\active \catcode\underChar=\active
+ \ifallowcodebreaks
+ \let-\codedash
+ \let_\codeunder
+ \else
+ \let-\normaldash
+ \let_\realunder
+ \fi
+ \codex
+ }
+}
+
+\def\codex #1{\tclose{#1}\endgroup}
+
+\def\normaldash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{%
+ % this is all so @math{@code{var_name}+1} can work. In math mode, _
+ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+ % will therefore expand the active definition of _, which is us
+ % (inside @code that is), therefore an endless loop.
+ \ifusingtt{\ifmmode
+ \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+ \else\normalunderscore \fi
+ \discretionary{}{}{}}%
+ {\_}%
+}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__. This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
+%
+\newif\ifallowcodebreaks \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\keywordtrue
+ \allowcodebreakstrue
+ \else\ifx\txiarg\keywordfalse
+ \allowcodebreaksfalse
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
+ \fi\fi
+}
+
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
+\let\command=\code
+\let\env=\code
+\let\file=\code
+\let\option=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url.
+% (This \urefnobreak definition isn't used now, leaving it for a while
+% for comparison.)
+\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
+\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% This \urefbreak definition is the active one.
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \urefcode{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+ \catcode\ampChar=\active \catcode\dotChar=\active
+ \catcode\hashChar=\active \catcode\questChar=\active
+ \catcode\slashChar=\active
+}
+{
+ \urefcatcodes
+ %
+ \global\def\urefcode{\begingroup
+ \setupmarkupstyle{code}%
+ \urefcatcodes
+ \let&\urefcodeamp
+ \let.\urefcodedot
+ \let#\urefcodehash
+ \let?\urefcodequest
+ \let/\urefcodeslash
+ \codex
+ }
+ %
+ % By default, they are just regular characters.
+ \global\def&{\normalamp}
+ \global\def.{\normaldot}
+ \global\def#{\normalhash}
+ \global\def?{\normalquest}
+ \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's. The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+ \catcode`\/=\active
+ \global\def\urefcodeslashfinish{%
+ \urefprestretch \slashChar
+ % Allow line break only after the final / in a sequence of
+ % slashes, to avoid line break between the slashes in http://.
+ \ifx\next/\else \urefpoststretch \fi
+ }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that. Also allow no breaking at all, for manual control.
+%
+\parseargdef\urefbreakstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\wordnone
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordbefore
+ \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+ \else\ifx\txiarg\wordafter
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+ \def\one{#1}\def\three{#3}\def\threex{??}%
+ \ifx\one\xkey\ifx\threex\three \key{#2}%
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge. Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+% \vbox{\hrule\kern-0.4pt
+% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+% \kern-0.4pt\hrule}%
+% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge. If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle. But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+ \nohyphenation
+ \ifmonospace\else\tt\fi
+ #1}\null}
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+ \null % reset \spacefactor=1000
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+ {\plainfrenchspacing #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+ \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode`\_ = \active
+ \gdef\mathunderscore{%
+ \catcode`\_=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ % make the texinfo accent commands work in math mode
+ \let\"=\ddot
+ \let\'=\acute
+ \let\==\bar
+ \let\^=\hat
+ \let\`=\grave
+ \let\u=\breve
+ \let\v=\check
+ \let\~=\tilde
+ \let\dotaccent=\dot
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \catcode`' = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ \let' = \ptexquoteright
+ }
+}
+
+% ctrl is no longer a Texinfo command, but leave this definition for fun.
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+%
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+ \def\inlinefmtname{#1}%
+ \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely. Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored. But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too. We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+%
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+ \def\inlinerawname{#1}%
+ \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+ \endgroup % close group opened by \tex.
+}
+
+
+\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+% Unless we're in typewriter, use \ecfont because the CM text fonts do
+% not have braces, and we don't want to switch into math.
+\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
+\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
+\let\{=\mylbrace \let\lbracechar=\{
+\let\}=\myrbrace \let\rbracechar=\}
+\begingroup
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux/toc files.
+ \catcode`\{ = \other \catcode`\} = \other
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+ \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{%
+ \ifx\textnominalsize\xwordpt
+ % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+ % Revert to plain's \scriptsize, which is 7pt.
+ \count255=\the\fam $\fam\count255 \scriptstyle A$%
+ \else
+ % For 11pt, we can use our lllsize.
+ \selectfonts\lllsize A%
+ \fi
+ }%
+ \vss
+ }}%
+ \kern-.15em
+ \TeX
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em. So do
+% whichever is larger.
+%
+\def\dots{%
+ \leavevmode
+ \setbox0=\hbox{...}% get width of three periods
+ \ifdim\wd0 > 1.5em
+ \dimen0 = \wd0
+ \else
+ \dimen0 = 1.5em
+ \fi
+ \hbox to \dimen0{%
+ \hskip 0pt plus.25fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, they should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
+\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{%
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that. The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math. Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+ % We set the font at each command, rather than predefining it in
+ % \textfonts and the other font-switching commands, so that
+ % installations which never need the symbol don't have to have the
+ % font installed.
+ %
+ % There is only one designed size (nominal 10pt), so we always scale
+ % that to the current nominal size.
+ %
+ % By the way, simply using "at 1em" works for cmr10 and the like, but
+ % does not work for cmbx10 and other extended/shrunken fonts.
+ %
+ \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+ %
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+ \else
+ % regular:
+ \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+ \fi
+ \thiseurofont
+}
+
+% Glyphs from the EC fonts. We don't use \let for the aliases, because
+% sometimes we redefine the original macro, and the alias should reflect
+% the redefinition.
+%
+% Use LaTeX names for the Icelandic letters.
+\def\DH{{\ecfont \char"D0}} % Eth
+\def\dh{{\ecfont \char"F0}} % eth
+\def\TH{{\ecfont \char"DE}} % Thorn
+\def\th{{\ecfont \char"FE}} % thorn
+%
+\def\guillemetleft{{\ecfont \char"13}}
+\def\guillemotleft{\guillemetleft}
+\def\guillemetright{{\ecfont \char"14}}
+\def\guillemotright{\guillemetright}
+\def\guilsinglleft{{\ecfont \char"0E}}
+\def\guilsinglright{{\ecfont \char"0F}}
+\def\quotedblbase{{\ecfont \char"12}}
+\def\quotesinglbase{{\ecfont \char"0D}}
+%
+% This positioning is not perfect (see the ogonek LaTeX package), but
+% we have the precomposed glyphs for the most common cases. We put the
+% tests to use those glyphs in the single \ogonek macro so we have fewer
+% dummy definitions to worry about for index entries, etc.
+%
+% ogonek is also used with other letters in Lithuanian (IOU), but using
+% the precomposed glyphs for those is not so easy since they aren't in
+% the same EC font.
+\def\ogonek#1{{%
+ \def\temp{#1}%
+ \ifx\temp\macrocharA\Aogonek
+ \else\ifx\temp\macrochara\aogonek
+ \else\ifx\temp\macrocharE\Eogonek
+ \else\ifx\temp\macrochare\eogonek
+ \else
+ \ecfont \setbox0=\hbox{#1}%
+ \ifdim\ht0=1ex\accent"0C #1%
+ \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
+ \fi
+ \fi\fi\fi\fi
+ }%
+}
+\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
+\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
+\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
+\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
+%
+% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
+\def\ecfont{%
+ % We can't distinguish serif/sans and italic/slanted, but this
+ % is used for crude hacks anyway (like adding French and German
+ % quotes to documents typeset with CM, where we lose kerning), so
+ % hopefully nobody will notice/care.
+ \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
+ \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
+ \ifmonospace
+ % typewriter:
+ \font\thisecfont = ectt\ecsize \space at \nominalsize
+ \else
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+ \else
+ % regular:
+ \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+ \fi
+ \fi
+ \thisecfont
+}
+
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
+% @textdegree - the normal degrees sign.
+%
+\def\textdegree{$^\circ$}
+
+% Laurent Siebenmann reports \Orb undefined with:
+% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\thisisundefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+% Quotes.
+\chardef\quotedblleft="5C
+\chardef\quotedblright=`\"
+\chardef\quoteleft=`\`
+\chardef\quoteright=`\'
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{%
+ \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \let\page = \oldpage
+ \page
+ \null
+ }%
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right. This should be used
+% inside a \vbox, and fonts need to be set appropriately first. Because
+% it is always used for titles, nothing else, we call \rmisbold. \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+%
+\def\raggedtitlesettings{%
+ \rmisbold
+ \hyphenpenalty=10000
+ \parindent=0pt
+ \tolerance=5000
+ \ptexraggedright
+}
+
+% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \vbox{\titlefonts \raggedtitlesettings #1\par}%
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\secfonts\rmisbold \leftline{#1}}%
+ \fi
+}
+
+
+% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -12pt
+ \global\advance\vsize by -12pt
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+% @evenheadingmarks top \thischapter <- chapter at the top of a page
+% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
+%
+% The same set of arguments for:
+%
+% @oddheadingmarks
+% @evenfootingmarks
+% @oddfootingmarks
+% @everyheadingmarks
+% @everyfootingmarks
+
+\def\evenheadingmarks{\headingmarks{even}{heading}}
+\def\oddheadingmarks{\headingmarks{odd}{heading}}
+\def\evenfootingmarks{\headingmarks{even}{footing}}
+\def\oddfootingmarks{\headingmarks{odd}{footing}}
+\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+ \headingmarks{odd}{heading}{#1} }
+\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+ \headingmarks{odd}{footing}{#1} }
+% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
+\def\headingmarks#1#2#3 {%
+ \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
+ \global\expandafter\let\csname get#1#2marks\endcsname \temp
+}
+
+\everyheadingmarks bottom
+\everyfootingmarks bottom
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\headingsoff{% non-global headings elimination
+ \evenheadline={\hfil}\evenfootline={\hfil}%
+ \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff % it's the default
+
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\thisisundefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemindicate{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil\relax
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. However, if
+ % what follows is an environment such as @example, there will be no
+ % \parskip glue; then the negative vskip we just inserted would
+ % cause the example and the item to crash together. So we use this
+ % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+ % \parskip glue after all. Section titles are handled this way also.
+ %
+ \penalty 10001
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablecheck{table}%
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablecheck{ftable}%
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+ \ifnum \the\catcode`\^^M=\active
+ \endgroup
+ \errmessage{This command won't work in this context; perhaps the problem is
+ that we are \inenvironment\thisenv}%
+ \def\next{\doignore{#1}}%
+ \else
+ \let\next\tablex
+ \fi
+ \next
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ %
+ % Try typesetting the item mark that if the document erroneously says
+ % something like @itemize @samp (intending @table), there's an error
+ % right away at the @itemize. It's not the best error message in the
+ % world, but it's better than leaving it to the @item. This means if
+ % the user wants an empty mark, they have to say @w{} not just @w.
+ \def\itemcontents{#1}%
+ \setbox0 = \hbox{\itemcontents}%
+ %
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ %
+ \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ %
+ \vadjust{\penalty 1200}}% not good to break after first line of item.
+ \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry. \everycr resets \everytab so we don't have to
+% undo it ourselves.
+\def\headitemfont{\b}% for people to use in the template row; not changeable
+\def\headitem{%
+ \checkenv\multitable
+ \crcr
+ \global\everytab={\bf}% can't use \headitemfont since the parsing differs
+ \the\everytab % for the first item
+}%
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we again encounter the problem the 1sp was intended to solve.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
+ \vskip\parskip
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ % We use \def instead of \let so that if one of the multitable entries
+ % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+ % \endtemplate) expanding \doitemize.
+ \def\item{\crcr}%
+ %
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}%
+ \global\colcount=0 % Reset the column counter.
+ % Check for saved footnotes, etc.
+ \checkinserts
+ % Keeps underfull box messages off when table breaks over pages.
+ %\filbreak
+ % Maybe so, but it also creates really weird page breaks when the
+ % table breaks over pages. Wouldn't \vfil be better? Wait until the
+ % problem manifests itself, so it can be fixed for real --karl.
+ }%
+ }%
+ %
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+ \def\multistrut{\strut}% just use the standard line spacing
+ %
+ % Compute \multitablelinespace (if not defined by user) for use in
+ % \multitableparskip calculation. We used define \multistrut based on
+ % this, but (ironically) that caused the spacing to be off.
+ % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+ % than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+ % Scan in ``verbatim'' mode:
+ \obeylines
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \spaceisspace
+ %
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
+ %
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
+ %
+ \gdef\dodoignore#1{%
+ % #1 contains the command name as a string, e.g., `ifinfo'.
+ %
+ % Define a command to find the next `@end #1'.
+ \long\def\doignoretext##1^^M@end #1{%
+ \doignoretextyyy##1^^M@#1\_STOP_}%
+ %
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+ %
+ % And now expand that command.
+ \doignoretext ^^M%
+ }%
+}
+
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+{ \obeylines%
+ % Ignore anything after the last `@end #1'; this matters in verbatim
+ % environments, where otherwise the newline after an ignored conditional
+ % would result in a blank line in the output.
+ \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
+}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+ \catcode`\- = \active \catcode`\_ = \active
+ %
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
+ \catcode`\-=\other \catcode`\_=\other
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\normaldash \let_\normalunderscore
+ }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined. We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+%
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname #2\endcsname\relax
+ #1% If not defined, \let\next as above.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+ \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \relax
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+ \escapechar = `\\ % use backslash in output files.
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ %
+ % Need these unexpandable (because we define \tt as a dummy)
+ % definitions when @{ or @} appear in index entry text. Also, more
+ % complicated, when \tex is in effect and \{ is a \delimiter again.
+ % We can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters. Perhaps we
+ % should define @lbrace and @rbrace commands a la @comma.
+ \def\{{{\tt\char123}}%
+ \def\}{{\tt\char125}}%
+ %
+ % I don't entirely understand this, but when an index entry is
+ % generated from a macro call, the \endinput which \scanmacro inserts
+ % causes processing to be prematurely terminated. This is,
+ % apparently, because \indexsorttmp is fully expanded, and \endinput
+ % is an expandable command. The redefinition below makes \endinput
+ % disappear altogether for that purpose -- although logging shows that
+ % processing continues to some further point. On the other hand, it
+ % seems \endinput does not hurt in the printed index arg, since that
+ % is still getting written without apparent harm.
+ %
+ % Sample source (mac-idx3.tex, reported by Graham Percival to
+ % help-texinfo, 22may06):
+ % @macro funindex {WORD}
+ % @findex xyz
+ % @end macro
+ % ...
+ % @funindex commtest
+ %
+ % The above is not enough to reproduce the bug, but it gives the flavor.
+ %
+ % Sample whatsit resulting:
+ % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
+ %
+ % So:
+ \let\endinput = \empty
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux and toc files, @ is the escape character. So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files). When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % Do the redefinitions.
+ \commondummies
+ \otherbackslash
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+ %
+ % \definedummyword defines \#1 as \string\#1\space, thus effectively
+ % preventing its expansion. This is used only for control words,
+ % not control letters, because the \space would be incorrect for
+ % control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword ##1{\def##1{\string##1\space}}%
+ \def\definedummyletter##1{\def##1{\string##1}}%
+ \let\definedummyaccent\definedummyletter
+ %
+ \commondummiesnofonts
+ %
+ \definedummyletter\_%
+ \definedummyletter\-%
+ %
+ % Non-English letters.
+ \definedummyword\AA
+ \definedummyword\AE
+ \definedummyword\DH
+ \definedummyword\L
+ \definedummyword\O
+ \definedummyword\OE
+ \definedummyword\TH
+ \definedummyword\aa
+ \definedummyword\ae
+ \definedummyword\dh
+ \definedummyword\exclamdown
+ \definedummyword\l
+ \definedummyword\o
+ \definedummyword\oe
+ \definedummyword\ordf
+ \definedummyword\ordm
+ \definedummyword\questiondown
+ \definedummyword\ss
+ \definedummyword\th
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword\bf
+ \definedummyword\gtr
+ \definedummyword\hat
+ \definedummyword\less
+ \definedummyword\sf
+ \definedummyword\sl
+ \definedummyword\tclose
+ \definedummyword\tt
+ %
+ \definedummyword\LaTeX
+ \definedummyword\TeX
+ %
+ % Assorted special characters.
+ \definedummyword\arrow
+ \definedummyword\bullet
+ \definedummyword\comma
+ \definedummyword\copyright
+ \definedummyword\registeredsymbol
+ \definedummyword\dots
+ \definedummyword\enddots
+ \definedummyword\entrybreak
+ \definedummyword\equiv
+ \definedummyword\error
+ \definedummyword\euro
+ \definedummyword\expansion
+ \definedummyword\geq
+ \definedummyword\guillemetleft
+ \definedummyword\guillemetright
+ \definedummyword\guilsinglleft
+ \definedummyword\guilsinglright
+ \definedummyword\lbracechar
+ \definedummyword\leq
+ \definedummyword\minus
+ \definedummyword\ogonek
+ \definedummyword\pounds
+ \definedummyword\point
+ \definedummyword\print
+ \definedummyword\quotedblbase
+ \definedummyword\quotedblleft
+ \definedummyword\quotedblright
+ \definedummyword\quoteleft
+ \definedummyword\quoteright
+ \definedummyword\quotesinglbase
+ \definedummyword\rbracechar
+ \definedummyword\result
+ \definedummyword\textdegree
+ %
+ % We want to disable all macros so that they are not expanded by \write.
+ \macrolist
+ %
+ \normalturnoffactive
+ %
+ % Handle some cases of @value -- where it does not contain any
+ % (non-fully-expandable) commands.
+ \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+\def\commondummiesnofonts{%
+ % Control letters and accents.
+ \definedummyletter\!%
+ \definedummyaccent\"%
+ \definedummyaccent\'%
+ \definedummyletter\*%
+ \definedummyaccent\,%
+ \definedummyletter\.%
+ \definedummyletter\/%
+ \definedummyletter\:%
+ \definedummyaccent\=%
+ \definedummyletter\?%
+ \definedummyaccent\^%
+ \definedummyaccent\`%
+ \definedummyaccent\~%
+ \definedummyword\u
+ \definedummyword\v
+ \definedummyword\H
+ \definedummyword\dotaccent
+ \definedummyword\ogonek
+ \definedummyword\ringaccent
+ \definedummyword\tieaccent
+ \definedummyword\ubaraccent
+ \definedummyword\udotaccent
+ \definedummyword\dotless
+ %
+ % Texinfo font commands.
+ \definedummyword\b
+ \definedummyword\i
+ \definedummyword\r
+ \definedummyword\sansserif
+ \definedummyword\sc
+ \definedummyword\slanted
+ \definedummyword\t
+ %
+ % Commands that take arguments.
+ \definedummyword\abbr
+ \definedummyword\acronym
+ \definedummyword\anchor
+ \definedummyword\cite
+ \definedummyword\code
+ \definedummyword\command
+ \definedummyword\dfn
+ \definedummyword\dmn
+ \definedummyword\email
+ \definedummyword\emph
+ \definedummyword\env
+ \definedummyword\file
+ \definedummyword\image
+ \definedummyword\indicateurl
+ \definedummyword\inforef
+ \definedummyword\kbd
+ \definedummyword\key
+ \definedummyword\math
+ \definedummyword\option
+ \definedummyword\pxref
+ \definedummyword\ref
+ \definedummyword\samp
+ \definedummyword\strong
+ \definedummyword\tie
+ \definedummyword\uref
+ \definedummyword\url
+ \definedummyword\var
+ \definedummyword\verb
+ \definedummyword\w
+ \definedummyword\xref
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+ % Accent commands should become @asis.
+ \def\definedummyaccent##1{\let##1\asis}%
+ % We can just ignore other control letters.
+ \def\definedummyletter##1{\let##1\empty}%
+ % All control words become @asis by default; overrides below.
+ \let\definedummyword\definedummyaccent
+ %
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ \def\ { }%
+ \def\@{@}%
+ \def\_{\normalunderscore}%
+ \def\-{}% @- shouldn't affect sorting
+ %
+ % Unfortunately, texindex is not prepared to handle braces in the
+ % content at all. So for index sorting, we map @{ and @} to strings
+ % starting with |, since that ASCII character is between ASCII { and }.
+ \def\{{|a}%
+ \def\lbracechar{|a}%
+ %
+ \def\}{|b}%
+ \def\rbracechar{|b}%
+ %
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\DH{DZZ}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\TH{ZZZ}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\dh{dzz}%
+ \def\exclamdown{!}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ \def\o{o}%
+ \def\questiondown{?}%
+ \def\ss{ss}%
+ \def\th{zzz}%
+ %
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
+ %
+ % Assorted special characters.
+ % (The following {} will end up in the sort string, but that's ok.)
+ \def\arrow{->}%
+ \def\bullet{bullet}%
+ \def\comma{,}%
+ \def\copyright{copyright}%
+ \def\dots{...}%
+ \def\enddots{...}%
+ \def\equiv{==}%
+ \def\error{error}%
+ \def\euro{euro}%
+ \def\expansion{==>}%
+ \def\geq{>=}%
+ \def\guillemetleft{<<}%
+ \def\guillemetright{>>}%
+ \def\guilsinglleft{<}%
+ \def\guilsinglright{>}%
+ \def\leq{<=}%
+ \def\minus{-}%
+ \def\point{.}%
+ \def\pounds{pounds}%
+ \def\print{-|}%
+ \def\quotedblbase{"}%
+ \def\quotedblleft{"}%
+ \def\quotedblright{"}%
+ \def\quoteleft{`}%
+ \def\quoteright{'}%
+ \def\quotesinglbase{,}%
+ \def\registeredsymbol{R}%
+ \def\result{=>}%
+ \def\textdegree{o}%
+ %
+ \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
+ \else \indexlquoteignore \fi
+ %
+ % We need to get rid of all macros, leaving only the arguments (if present).
+ % Of course this is not nearly correct, but it is the best we can do for now.
+ % makeinfo does not expand macros in the argument to @deffn, which ends up
+ % writing an index entry, and texindex isn't prepared for an index sort entry
+ % that starts with \.
+ %
+ % Since macro invocations are followed by braces, we can just redefine them
+ % to take a single TeX argument. The case of a macro invocation that
+ % goes to end-of-line is not handled.
+ %
+ \macrolist
+}
+
+% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
+% ignore left quotes in the sort term.
+{\catcode`\`=\active
+ \gdef\indexlquoteignore{\let`=\empty}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \safewhatsit\dosubindwrite
+ }%
+ \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \fi
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+ }%
+ \temp
+}
+
+% Take care of unwanted page breaks/skips around a whatsit:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write or \pdfdest will make \lastskip zero. The result is that
+% sequences like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+\newskip\whatsitskip
+\newcount\whatsitpenalty
+%
+% ..., ready, GO:
+%
+\def\safewhatsit#1{\ifhmode
+ #1%
+ \else
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \whatsitskip = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \whatsitpenalty = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\whatsitskip glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\whatsitskip
+ \fi
+ %
+ #1%
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % If \lastskip was zero, perhaps the last item was a penalty, and
+ % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
+ % to re-insert the same penalty (values >10000 are used for various
+ % signals); since we just inserted a non-discardable item, any
+ % following glue (such as a \parskip) would be a breakpoint. For example:
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\whatsitskip
+ \fi
+\fi}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \plainfrenchspacing
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\backslashcurfont}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \nobreak
+ \vskip 0pt plus 3\baselineskip
+ \penalty 0
+ \vskip 0pt plus -3\baselineskip
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ % Do our best not to break after the initial.
+ \nobreak
+ \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+% \def\entry#1#2{...
+% But this freezes the catcodes in the argument, and can cause problems to
+% @code, which sets - active. This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+% The right solution is to prevent \entry from swallowing the whole text.
+% --kasal, 21nov03
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing
+ % columns.
+ \vskip 0pt plus1pt
+ %
+ % When reading the text of entry, convert explicit line breaks
+ % from @* into spaces. The user might give these in long section
+ % titles, for instance.
+ \def\*{\unskip\space\ignorespaces}%
+ \def\entrybreak{\hfil\break}%
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\entrybreak{\unskip\space\ignorespaces}%
+\def\doentry{%
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+ % #1 is the page number.
+ %
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \setbox\boxA = \hbox{#1}%
+ \ifdim\wd\boxA = 0pt
+ \ %
+ \else
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#1.%
+ \ \the\toksA
+ \else
+ \ #1%
+ \fi
+ \fi
+ \par
+ \endgroup
+}
+
+% Like plain.tex's \dotfill, except uses up at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ % The following penalty ensures that the page builder is exercised
+ % _before_ we change the output routine. This is necessary in the
+ % following situation:
+ %
+ % The last section of the index consists only of a single entry.
+ % Before this section, \pagetotal is less than \pagegoal, so no
+ % break occurs before the last section starts. However, the last
+ % section, consisting of \initial and the single \entry, does not
+ % fit on the page and has to be broken off. Without the following
+ % penalty the page builder will not be exercised until \eject
+ % below, and by that time we'll already have changed the output
+ % routine to the \balancecolumns version, so the next-to-last
+ % double-column page will be processed with \balancecolumns, which
+ % is wrong: The two columns will go to the main vertical list, with
+ % the broken-off section in the recent contributions. As soon as
+ % the output routine finishes, TeX starts reconsidering the page
+ % break. The two columns and the broken-off section both fit on the
+ % page, because the two columns now take up only half of the page
+ % goal. When TeX sees \eject from below which follows the final
+ % section, it invokes the new output routine that we've set after
+ % \balancecolumns below; \onepageout will try to fit the two columns
+ % and the final section into the vbox of \pageheight (see
+ % \pagebody), causing an overfull box.
+ %
+ % Note that glue won't work here, because glue does not exercise the
+ % page builder, unlike penalties (see The TeXbook, pp. 280-281).
+ \penalty0
+ %
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+ \chapoddpage
+ \null
+ \vskip.3\vsize % move it down on the page a bit
+ \begingroup
+ \noindent \titlefonts\rmisbold #1\par % the text
+ \let\lastnode=\empty % no node to associate with
+ \writetocentry{part}{#1}{}% but put it in the toc
+ \headingsoff % no headline or footline on the part page
+ \chapoddpage
+ \endgroup
+}
+
+% \unnumberedno is an oxymoron. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines these (using marks) as the number+name, number
+% and name of the chapter. Page headings and footings can use
+% these. @section does likewise.
+\def\thischapter{}
+\def\thischapternum{}
+\def\thischaptername{}
+\def\thissection{}
+\def\thissectionnum{}
+\def\thissectionname{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+ % Compute the abs. sec. level:
+ \absseclevel=#2
+ \advance\absseclevel by \secbase
+ % Make sure \absseclevel doesn't fall outside the range:
+ \ifnum \absseclevel < 0
+ \absseclevel = 0
+ \else
+ \ifnum \absseclevel > 3
+ \absseclevel = 3
+ \fi
+ \fi
+ % The heading type:
+ \def\headtype{#1}%
+ \if \headtype U%
+ \ifnum \absseclevel < \unnlevel
+ \chardef\unnlevel = \absseclevel
+ \fi
+ \else
+ % Check for appendix sections:
+ \ifnum \absseclevel = 0
+ \edef\chapheadtype{\headtype}%
+ \else
+ \if \headtype A\if \chapheadtype N%
+ \errmessage{@appendix... within a non-appendix chapter}%
+ \fi\fi
+ \fi
+ % Check for numbered within unnumbered:
+ \ifnum \absseclevel > \unnlevel
+ \def\headtype{U}%
+ \else
+ \chardef\unnlevel = 3
+ \fi
+ \fi
+ % Now print the heading:
+ \if \headtype U%
+ \ifcase\absseclevel
+ \unnumberedzzz{#3}%
+ \or \unnumberedseczzz{#3}%
+ \or \unnumberedsubseczzz{#3}%
+ \or \unnumberedsubsubseczzz{#3}%
+ \fi
+ \else
+ \if \headtype A%
+ \ifcase\absseclevel
+ \appendixzzz{#3}%
+ \or \appendixsectionzzz{#3}%
+ \or \appendixsubseczzz{#3}%
+ \or \appendixsubsubseczzz{#3}%
+ \fi
+ \else
+ \ifcase\absseclevel
+ \chapterzzz{#3}%
+ \or \seczzz{#3}%
+ \or \numberedsubseczzz{#3}%
+ \or \numberedsubsubseczzz{#3}%
+ \fi
+ \fi
+ \fi
+ \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ % \putwordChapter can contain complex things in translations.
+ \toks0=\expandafter{\putwordChapter}%
+ \message{\the\toks0 \space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
+%
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ % \putwordAppendix can contain complex things in translations.
+ \toks0=\expandafter{\putwordAppendix}%
+ \message{\the\toks0 \space \appendixletter}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
+
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+ %
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+ % Well, we could do the following in a group, but that would break
+ % an assumption that \chapmacro is called at the outermost level.
+ % Thus we are safer this way: --kasal, 24feb04
+ \let\centerparametersmaybe = \centerparameters
+ \unnmhead0{#1}%
+ \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+%
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+%
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+%
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+\def\majorheading{%
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip \nobreak
+ \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+% Parameter controlling skip before chapter headings (if needed)
+\newskip\chapheadingskip
+
+% Define plain chapter starts, and page on/off switching for it.
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+% Because \domark is called before \chapoddpage, the filler page will
+% get the headings for the next chapter, which is wrong. But we don't
+% care -- we just disable all headings on the filler page.
+\def\chapoddpage{%
+ \chappager
+ \ifodd\pageno \else
+ \begingroup
+ \headingsoff
+ \null
+ \chappager
+ \endgroup
+ \fi
+}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+ % Insert the first mark before the heading break (see notes for \domark).
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+ \gdef\thissection{}}%
+ %
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{\thischaptername}}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{}}%
+ \else\ifx\temptype\Yappendixkeyword
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\appendixletter}%
+ % \noexpand\putwordAppendix avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
+ \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \else
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\the\chapno}%
+ % \noexpand\putwordChapter avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
+ \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \fi\fi\fi
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert the chapter heading break.
+ \pchapsepmacro
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ {%
+ \chapfonts \rmisbold
+ %
+ % Have to define \lastsection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\lastsection{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
+ \nobreak % Avoid page breaks at the interline glue.
+ \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings #1\par}%
+ \nobreak\bigskip\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+ \chapoddpage
+ \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+ \nobreak\bigskip \nobreak
+}
+\def\CHAPFopen{%
+ \global\let\chapmacro=\chfopen
+ \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\seckeyword{sec}
+%
+\def\sectionheading#1#2#3#4{%
+ {%
+ \checkenv{}% should not be in an environment.
+ %
+ % Switch to the right set of fonts.
+ \csname #2fonts\endcsname \rmisbold
+ %
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
+ %
+ % Insert first mark before the heading break (see notes for \domark).
+ \let\prevsectiondefs=\lastsectiondefs
+ \ifx\temptype\Ynothingkeyword
+ \ifx\sectionlevel\seckeyword
+ \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+ \gdef\thissection{\thissectionname}}%
+ \fi
+ \else\ifx\temptype\Yomitfromtockeyword
+ % Don't redefine \thissection.
+ \else\ifx\temptype\Yappendixkeyword
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ % \noexpand\putwordSection avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thissection{\noexpand\putwordSection{}
+ \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \else
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ % \noexpand\putwordSection avoids expanding indigestible
+ % commands in some of the translations.
+ \gdef\noexpand\thissection{\noexpand\putwordSection{}
+ \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \fi\fi\fi
+ %
+ % Go into vertical mode. Usually we'll already be there, but we
+ % don't want the following whatsit to end up in a preceding paragraph
+ % if the document didn't happen to have a blank line.
+ \par
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ % Only insert the space after the number if we have a section number.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\lastsection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \lastsection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\lastsection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\lastsection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chapmacro.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chapmacro.
+ \donoderef{#3}%
+ %
+ % Interline glue will be inserted when the vbox is completed.
+ % That glue will be a valid breakpoint for the page, since it'll be
+ % preceded by a whatsit (usually from the \donoderef, or from the
+ % \writetocentry if there was no node). We don't want to allow that
+ % break, since then the whatsits could end up on page n while the
+ % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
+ \nobreak
+ %
+ % Output the actual section heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
+ }%
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
+ \nobreak
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.) However, when a paragraph is not started next
+ % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+ % or the negative glue will cause weirdly wrong output, typically
+ % obscuring the section heading with something else.
+ \vskip-\parskip
+ %
+ % This is so the last item on the main vertical list is a known
+ % \penalty > 10000, so \startdefun, etc., can recognize the situation
+ % and do the needful.
+ \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ {\atdummies
+ \edef\temp{%
+ \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+ \temp
+ }%
+ \fi
+ \fi
+ %
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care. This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+ \catcode`\"=\active
+ \catcode`\$=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \catcode`\\=\active
+ \catcode`\^=\active
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+ \setupdatafile
+ \activecatcodes
+ \input \tocreadfilename
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+% redefined for the two-volume lispref. We always output on
+% \jobname.toc even if this is redefined.
+%
+\def\tocreadfilename{\jobname.toc}
+
+% Normal (long) toc.
+%
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\partentry = \shortpartentry
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Parts, in the main contents. Replace the part number, which doesn't
+% exist, with an empty box. Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+ \penalty-300
+ \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+ \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @tex ... @end tex escapes into raw TeX temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain @ character.
+
+\envdef\tex{%
+ \setupmarkupstyle{tex}%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \catcode`\`=\other
+ \catcode`\'=\other
+ \escapechar=`\\
+ %
+ % ' is active in math mode (mathcode"8000). So reset it, and all our
+ % other math active characters (just in case), to plain's definitions.
+ \mathactive
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+ \expandafter \let\csname top\endcsname=\ptextop % outer
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing = t%
+ %
+ % If this cartouche directly follows a sectioning command, we need the
+ % \parskip glue (backspaced over by default) or the cartouche can
+ % collide with the section heading.
+ \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+ %
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of def\group.
+}
+\def\Ecartouche{%
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\newdimen\nonfillparindent
+\def\nonfillstart{%
+ \aboveenvbreak
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ % Turn off paragraph indentation but redefine \indent to emulate
+ % the normal \indent.
+ \nonfillparindent=\parindent
+ \parindent = 0pt
+ \let\indent\nonfillindent
+ %
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \let\exdent=\nofillexdent
+}
+
+\begingroup
+\obeyspaces
+% We want to swallow spaces (but not other tokens) after the fake
+% @indent in our nonfill-environments, where spaces are normally
+% active and set to @tie, resulting in them not being ignored after
+% @indent.
+\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
+\gdef\nonfillindentcheck{%
+\ifx\temp %
+\expandafter\nonfillindentgobble%
+\else%
+\leavevmode\nonfillindentbox%
+\fi%
+}%
+\endgroup
+\def\nonfillindentgobble#1{\nonfillindent}
+\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ % end paragraph for sake of leading, in case document has no blank
+ % line. This is redundant with what happens in \aboveenvbreak, but
+ % we need to do it before changing the fonts, and it's inconvenient
+ % to change the fonts afterward.
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it in one command. #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+ \makedispenvdef{#1}{#3}%
+ \makedispenvdef{#2}{#3}%
+}
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvdef{lisp}{example}{%
+ \nonfillstart
+ \tt\setupmarkupstyle{example}%
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenvdef{display}{%
+ \nonfillstart
+ \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenvdef{format}{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \advance\leftskip by 0pt plus 1fill\relax
+ \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @raggedright does more-or-less normal line breaking but no right
+% justification. From plain.tex.
+\envdef\raggedright{%
+ \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
+}
+\let\Eraggedright\par
+
+\envdef\raggedleft{%
+ \parindent=0pt \leftskip0pt plus2em
+ \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+ \hbadness=10000 % Last line will usually be underfull, so turn off
+ % badness reporting.
+}
+\let\Eraggedleft\par
+
+\envdef\raggedcenter{%
+ \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
+ \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+ \hbadness=10000 % Last line will usually be underfull, so turn off
+ % badness reporting.
+}
+\let\Eraggedcenter\par
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\makedispenvdef{quotation}{\quotationstart}
+%
+\def\quotationstart{%
+ \indentedblockstart % same as \indentedblock, but increase right margin too.
+ \ifx\nonarrowing\relax
+ \advance\rightskip by \lispnarrowing
+ \fi
+ \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\thisisundefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallquotation{\Equotation}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
+}
+
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+%
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+ \par
+ {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+ % Don't do the quotes -- if we do, @set txicodequoteundirected and
+ % @set txicodequotebacktick will not have effect on @verb and
+ % @verbatim, and ?` and !` ligatures won't get disabled.
+ %\do\`\do\'%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \setupmarkupstyle{verb}%
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion.
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs. The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group. Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset. Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
+%
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+ \divide\dimen\verbbox by\tabw
+ \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+ \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
+ \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
+ }%
+ }
+\endgroup
+
+% start the verbatim environment.
+\def\setupverbatim{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \tt % easiest (and conventionally used) font for verbatim
+ % The \leavevmode here is for blank lines. Otherwise, we would
+ % never \starttabox and the \egroup would end verbatim mode.
+ \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
+ \tabexpand
+ \setupmarkupstyle{verbatim}%
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count.
+ % Must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+ \input #1
+ \afterenvbreak
+ }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+ \begingroup
+ \parindent = 0pt % paragraph indentation looks wrong on title page
+ \scanexp\copyingtext
+ \endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+\newcount\defunpenalty
+
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
+ \defunpenalty=10003 % Will keep this @deffn together with the
+ % following @def command, see below.
+ \else
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check specifically for penalty 10002, inserted
+ % by \printdefunline, instead of 10000, since the sectioning
+ % commands also insert a nobreak penalty, and we don't want to allow
+ % a break between a section heading and a defun.
+ %
+ % As a further refinement, we avoid "club" headers by signalling
+ % with penalty of 10003 after the very first @deffn in the
+ % sequence (see above), and penalty of 10002 after any following
+ % @def command.
+ \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
+ \fi
+ %
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil\relax
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty\defunpenalty % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remaining is to define \deffnheader.
+%
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \doingtypefnfalse % distinguish typed functions from all else
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
+}
+
+\newif\ifdoingtypefn % doing typed function?
+\newif\ifrettypeownline % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line. This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+%
+\parseargdef\deftypefnnewline{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETtxideftypefnnl\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @txideftypefnnl value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \doingtypefntrue
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+% Types:
+
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ \par
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % Determine if we are typesetting the return type of a typed function
+ % on a line by itself.
+ \rettypeownlinefalse
+ \ifdoingtypefn % doing a typed function specifically?
+ % then check user option for putting return type on its own line:
+ \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+ \rettypeownlinetrue
+ \fi
+ \fi
+ %
+ % How we'll format the category name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape. We'll always have at
+ % least two.
+ \tempnum = 2
+ %
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ %
+ % If doing a return type on its own line, we'll have another line.
+ \ifrettypeownline
+ \advance\tempnum by 1
+ \def\maybeshapeline{0in \hsize}%
+ \else
+ \def\maybeshapeline{}%
+ \fi
+ %
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ %
+ % The final paragraph shape:
+ \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
+ %
+ % Put the category name at the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% text of the return type
+ \ifx\temp\empty\else
+ \tclose{\temp}% typeset the return type
+ \ifrettypeownline
+ % put return type on its own line; prohibit line break following:
+ \hfil\vadjust{\nobreak}\break
+ \else
+ \space % type on same line, so just followed by a space
+ \fi
+ \fi % no return type
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. We used to recommend @var for that, so
+ % leave the code in, but it's strange for @var to lead to typewriter.
+ % Nowadays we recommend @code, since the difference between a ttsl hyphen
+ % and a tt hyphen is pretty tiny. @code also disables ?` !`.
+ \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+ #1%
+ \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
+
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
+}
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
+}
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
+}
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+% these should not use \errmessage; the glibc manual, at least, actually
+% has such constructs (when documenting function pointers).
+\def\badparencount{%
+ \message{Warning: unbalanced parentheses in @def...}%
+ \global\parencount=0
+}
+\def\badbrackcount{%
+ \message{Warning: unbalanced square brackets in @def...}%
+ \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\thisisundefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
+\fi
+
+\def\scanmacro#1{\begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ %
+ % Undo catcode changes of \startcontents and \doprintindex
+ % When called from @insertcopying or (short)caption, we need active
+ % backslash to get it printed correctly. Previously, we had
+ % \catcode`\\=\other instead. We'll see whether a problem appears
+ % with macro expansion. --kasal, 19aug04
+ \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+ %
+ % ... and for \example:
+ \spaceisspace
+ %
+ % The \empty here causes a following catcode 5 newline to be eaten as
+ % part of reading whitespace after a control sequence. It does not
+ % eat a catcode 13 newline. There's no good way to handle the two
+ % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
+ % would then have different behavior). See the Macro Details node in
+ % the manual for the workaround we recommend for macros and
+ % line-oriented commands.
+ %
+ \scantokens{#1\empty}%
+\endgroup}
+
+\def\scanexp#1{%
+ \edef\temp{\noexpand\scanmacro{#1}}%
+ \temp
+}
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% List of all defined macros in the form
+% \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+ \toks0 = \expandafter{\macrolist\definedummyword#1}%
+ \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+% \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
+% Non-ASCII encodings make 8-bit characters active, so un-activate
+% them to avoid their expansion. Must do this non-globally, to
+% confine the change to the current group.
+%
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+%
+\def\scanctxt{% used as subroutine
+ \catcode`\"=\other
+ \catcode`\+=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\~=\other
+ \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
+}
+
+\def\scanargctxt{% used for copying and captions, not macros.
+ \scanctxt
+ \catcode`\\=\other
+ \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{% used for @macro definitions
+ \scanctxt
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\^^M=\other
+ \usembodybackslash
+}
+
+\def\macroargctxt{% used when scanning invocations
+ \scanctxt
+ \catcode`\\=0
+}
+% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
+% for the single characters \ { }. Thus, we end up with the "commands"
+% that would be written @\ @{ @} in a Texinfo document.
+%
+% We already have @{ and @}. For @\, we define it here, and only for
+% this purpose, to produce a typewriter backslash (so, the @\ that we
+% define for @math can't be used with @macro calls):
+%
+\def\\{\normalbackslash}%
+%
+% We would like to do this for \, too, since that is what makeinfo does.
+% But it is not possible, because Texinfo already has a command @, for a
+% cedilla accent. Documents must use @comma{} instead.
+%
+% \anythingelse will almost certainly be an error of some kind.
+
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+%
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\margbackslash#1{\char`\#1 }
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0\relax
+ \else
+ \expandafter\parsemargdef \argl;%
+ \if\paramno>256\relax
+ \ifx\eTeXversion\thisisundefined
+ \errhelp = \EMsimple
+ \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+ \fi
+ \fi
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{Macro name \the\macname\space already defined}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ \addtomacrolist{\the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\parseargdef\unmacro{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\definedummyword\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx #1\relax
+ % remove this
+ \else
+ \noexpand\definedummyword \noexpand#1%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname#1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% For macro processing make @ a letter so that we can make Texinfo private macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
+% in the params list to some hook where the argument si to be expanded. If
+% there are less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.
+%
+% That gets used by \mbodybackslash (above).
+%
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+%
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef the body (nothing else will expand because of
+% the catcode regime underwhich the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, you need that no macro has more than 256 arguments, otherwise an
+% error is produced.
+\def\parsemargdef#1;{%
+ \paramno=0\def\paramlist{}%
+ \let\hash\relax
+ \let\xeatspaces\relax
+ \parsemargdefxxx#1,;,%
+ % In case that there are 10 or more arguments we parse again the arguments
+ % list to set new definitions for the \macarg.BLAH macros corresponding to
+ % each BLAH argument. It was anyhow needed to parse already once this list
+ % in order to count the arguments, and as macros with at most 9 arguments
+ % are by far more frequent than macro with 10 or more arguments, defining
+ % twice the \macarg.BLAH macros does not cost too much processing power.
+ \ifnum\paramno<10\relax\else
+ \paramno0\relax
+ \parsemmanyargdef@@#1,;,% 10 or more arguments
+ \fi
+}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+\def\parsemmanyargdef@@#1,{%
+ \if#1;\let\next=\relax
+ \else
+ \let\next=\parsemmanyargdef@@
+ \edef\tempb{\eatspaces{#1}}%
+ \expandafter\def\expandafter\tempa
+ \expandafter{\csname macarg.\tempb\endcsname}%
+ % Note that we need some extra \noexpand\noexpand, this is because we
+ % don't want \the to be expanded in the \parsermacbody as it uses an
+ % \xdef .
+ \expandafter\edef\tempa
+ {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+ \advance\paramno by 1\relax
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+%
+
+\catcode `\@\texiatcatcode
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\catcode `\@=11\relax
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition. It gets all the arguments values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+ \def\macargdeflist@{}%
+ \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+ \def\paramlist{#2,\nil@}%
+ \def\macroname{#1}%
+ \begingroup
+ \macroargctxt
+ \def\argvaluelist{#3,\nil@}%
+ \def\@tempa{#3}%
+ \ifx\@tempa\empty
+ \setemptyargvalues@
+ \else
+ \getargvals@@
+ \fi
+}
+
+%
+\def\getargvals@@{%
+ \ifx\paramlist\nilm@
+ % Some sanity check needed here that \argvaluelist is also empty.
+ \ifx\argvaluelist\nillm@
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Too many arguments in macro `\macroname'!}%
+ \fi
+ \let\next\macargexpandinbody@
+ \else
+ \ifx\argvaluelist\nillm@
+ % No more arguments values passed to macro. Set remaining named-arg
+ % macros to empty.
+ \let\next\setemptyargvalues@
+ \else
+ % pop current arg name into \@tempb
+ \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\paramlist}%
+ % pop current argument value into \@tempc
+ \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+ \expandafter\@tempa\expandafter{\argvaluelist}%
+ % Here \@tempb is the current arg name and \@tempc is the current arg value.
+ % First place the new argument macro definition into \@tempd
+ \expandafter\macname\expandafter{\@tempc}%
+ \expandafter\let\csname macarg.\@tempb\endcsname\relax
+ \expandafter\def\expandafter\@tempe\expandafter{%
+ \csname macarg.\@tempb\endcsname}%
+ \edef\@tempd{\long\def\@tempe{\the\macname}}%
+ \push@\@tempd\macargdeflist@
+ \let\next\getargvals@@
+ \fi
+ \fi
+ \next
+}
+
+\def\push@#1#2{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter{%
+ \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa
+\def\macvalstoargs@{%
+ % To do this we use the property that token registers that are \the'ed
+ % within an \edef expand only once. So we are going to place all argument
+ % values into respective token registers.
+ %
+ % First we save the token context, and initialize argument numbering.
+ \begingroup
+ \paramno0\relax
+ % Then, for each argument number #N, we place the corresponding argument
+ % value into a new token list register \toks#N
+ \expandafter\putargsintokens@\saveparamlist@,;,%
+ % Then, we expand the body so that argument are replaced by their
+ % values. The trick for values not to be expanded themselves is that they
+ % are within tokens and that tokens expand only once in an \edef .
+ \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+ % Now we restore the token stack pointer to free the token list registers
+ % which we have used, but we make sure that expanded body is saved after
+ % group.
+ \expandafter
+ \endgroup
+ \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+ }
+
+\def\macargexpandinbody@{%
+ %% Define the named-macro outside of this group and then close this group.
+ \expandafter
+ \endgroup
+ \macargdeflist@
+ % First the replace in body the macro arguments by their values, the result
+ % is in \@tempa .
+ \macvalstoargs@
+ % Then we point at the \norecurse or \gobble (for recursive) macro value
+ % with \@tempb .
+ \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+ % Depending on whether it is recursive or not, we need some tailing
+ % \egroup .
+ \ifx\@tempb\gobble
+ \let\@tempc\relax
+ \else
+ \let\@tempc\egroup
+ \fi
+ % And now we do the real job:
+ \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+ \@tempd
+}
+
+\def\putargsintokens@#1,{%
+ \if#1;\let\next\relax
+ \else
+ \let\next\putargsintokens@
+ % First we allocate the new token list register, and give it a temporary
+ % alias \@tempb .
+ \toksdef\@tempb\the\paramno
+ % Then we place the argument value into that token list register.
+ \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+ \expandafter\@tempb\expandafter{\@tempa}%
+ \advance\paramno by 1\relax
+ \fi
+ \next
+}
+
+% Save the token stack pointer into macro #1
+\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
+% Restore the token stack pointer from number in macro #1
+\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
+% newtoks that can be used non \outer .
+\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
+
+% Tailing missing arguments are set to empty
+\def\setemptyargvalues@{%
+ \ifx\paramlist\nilm@
+ \let\next\macargexpandinbody@
+ \else
+ \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+ \let\next\setemptyargvalues@
+ \fi
+ \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+ \expandafter\def\expandafter\@tempa\expandafter{%
+ \expandafter\def\csname macarg.#1\endcsname{}}%
+ \push@\@tempa\macargdeflist@
+ \def\paramlist{#2}%
+}
+
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+ \def#1{#3}%
+ \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+ \long\def#1{#3}%
+ \long\def#2{#4}%
+}
+
+% This defines a Texinfo @macro. There are eight cases: recursive and
+% nonrecursive macros of zero, one, up to nine, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+%
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else
+ \ifnum\paramno<10\relax % at most 9
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \else % 10 or more
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+ \fi
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % at most 9
+ \ifnum\paramno<10\relax
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % 10 or more:
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\getargvals@{\the\macname}{\argl}%
+ }%
+ \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+ \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
+ \fi
+ \fi
+ \fi}
+
+\catcode `\@\texiatcatcode\relax
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg).
+%
+\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \macnamexxx}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Make them active and then expand them all to nothing.
+%
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \addtomacrolist{#1}%
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{%
+ \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references. The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross, , , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
+ \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \lastsection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+ \pdfmkdest{#1}%
+ \iflinks
+ {%
+ \atdummies % preserve commands, but don't expand them
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\lastsection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
+ }%
+ \fi
+}
+
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+%
+\parseargdef\xrefautomaticsectiontitle{%
+ \def\temp{#1}%
+ \ifx\temp\onword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \empty
+ \else\ifx\temp\offword
+ \expandafter\let\csname SETxref-automatic-section-title\endcsname
+ = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+ must be on|off}%
+ \fi\fi
+}
+
+%
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ %
+ % Get args without leading/trailing spaces.
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+ %
+ \def\infofilename{\ignorespaces #4}%
+ \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+ %
+ \def\printedmanual{\ignorespaces #5}%
+ \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
+ %
+ % If the printed reference name (arg #3) was not explicitly given in
+ % the @xref, figure out what we want to use.
+ \ifdim \wd\printedrefnamebox = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+ % Not auto section-title: use node name inside the square brackets.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ % Auto section-title: use chapter/section title inside
+ % the square brackets if we have it.
+ \ifdim \wd\printedmanualbox > 0pt
+ % It is in another manual, so we don't have it; use node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We (should) know the real title if we have the xref values.
+ \def\printedrefname{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % Make link in pdf output.
+ \ifpdf
+ {\indexnofonts
+ \turnoffactive
+ \makevalueexpandable
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
+ \getfilename{#4}%
+ %
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \edef\pdfxrefdest{#1}%
+ \ifx\pdfxrefdest\empty
+ \def\pdfxrefdest{Top}% no empty targets
+ \else
+ \txiescapepdf\pdfxrefdest % escape PDF special chars
+ \fi
+ %
+ \leavevmode
+ \startlink attr{/Border [0 0 0]}%
+ \ifnum\filenamelength>0
+ goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ \else
+ goto name{\pdfmkpgn{\pdfxrefdest}}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \fi
+ %
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". We distinguish them by the
+ % LABEL-title being set to a magic string.
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd\printedrefnamebox = 0pt
+ \refx{#1-snt}{}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % If the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd\printedmanualbox > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
+ \else
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox to print the node names, TeX does not insert
+ % empty discretionaries after hyphens, which means that it will not
+ % find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens,
+ % this is a loss. Therefore, we give the text of the node name
+ % again, so it is as if TeX is seeing it for the first time.
+ %
+ \ifdim \wd\printedmanualbox > 0pt
+ % Cross-manual reference with a printed manual name.
+ %
+ \crossmanualxref{\cite{\printedmanual\unskip}}%
+ %
+ \else\ifdim \wd\infofilenamebox > 0pt
+ % Cross-manual reference with only an info filename (arg 4), no
+ % printed manual name (arg 5). This is essentially the same as
+ % the case above; we output the filename, since we have nothing else.
+ %
+ \crossmanualxref{\code{\infofilename\unskip}}%
+ %
+ \else
+ % Reference within this manual.
+ %
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via the macro below so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi\fi
+ \fi
+ \endlink
+\endgroup}
+
+% Output a cross-manual xref to #1. Used just above (twice).
+%
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+%
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input. By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font). Hopefully it will never happen in practice.
+%
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+%
+\def\crossmanualxref#1{%
+ \setbox\toprefbox = \hbox{Top\kern7sp}%
+ \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+ \ifdim \wd2 > 7sp % nonempty?
+ \ifdim \wd2 = \wd\toprefbox \else % same as Top?
+ \putwordSection{} ``\printedrefname'' \putwordin{}\space
+ \fi
+ \fi
+ #1%
+}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+\def\Yappendix{%
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname XR#1\endcsname
+ }%
+ \ifx\thisrefX\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ {\toks0 = {#1}% avoid expansion of possibly-complex value
+ \message{\linenumber Undefined cross reference `\the\toks0'.}}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \thisrefX
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file. Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions). But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+ {% The node name might contain 8-bit characters, which in our current
+ % implementation are changed to commands like @'e. Don't let these
+ % mess up the control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safexrefname{#1}%
+ }%
+ %
+ \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR\safexrefname\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
+ {\safexrefname}}%
+ \fi
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readdatafile{aux}%
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
+\def\setupdatafile{%
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % Make the characters 128-255 be printing characters.
+ {%
+ \count1=128
+ \def\loop{%
+ \catcode\count1=\other
+ \advance\count1 by 1
+ \ifnum \count1<256 \loop \fi
+ }%
+ }%
+ %
+ % @ is our escape character in .aux files, and we need braces.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+ \setupdatafile
+ \input\jobname.#1
+\endgroup}
+
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for Info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\gdef\dofootnote{%
+ \insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \hsize=\pagewidth
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ %
+ % Invoke rest of plain TeX footnote routine.
+ \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarly, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\thisisundefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \else \ifx\centersub\centerV
+ % for @center @image, we need a vbox so we can have our vertical space
+ \imagevmodetrue
+ \vbox\bgroup % vbox has better behavior than vtop herev
+ \fi\fi
+ %
+ \ifimagevmode
+ \nobreak\medskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \fi
+ %
+ % Leave vertical mode so that indentation from an enclosing
+ % environment such as @quotation is respected.
+ % However, if we're at the top level, we don't want the
+ % normal paragraph indentation.
+ % On the other hand, if we are in the case of @center @image, we don't
+ % want to start a paragraph, which will create a hsize-width box and
+ % eradicate the centering.
+ \ifx\centersub\centerV\else \noindent \fi
+ %
+ % Output the image.
+ \ifpdf
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \fi
+ %
+ \ifimagevmode
+ \medskip % space after a standalone image
+ \fi
+ \ifx\centersub\centerV \egroup \fi
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc. We don't actually implement floating yet, we always include the
+% float "here". But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \startsavinginserts
+ %
+ % We can't be used inside a paragraph.
+ \par
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \lastsection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\lastsection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline{\scanexp\thiscaption}%
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ %
+ % Space below caption.
+ \vskip\parskip
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \atdummies
+ %
+ % since we read the caption text in the macro world, where ^^M
+ % is turned into a normal character, we have to scan it back, so
+ % we don't write the literal three characters "^^M" into the aux file.
+ \scanexp{%
+ \xdef\noexpand\gtemp{%
+ \ifx\thisshortcaption\empty
+ \thiscaption
+ \else
+ \thisshortcaption
+ \fi
+ }%
+ }%
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
+ }%
+ \fi
+ \egroup % end of \vtop
+ %
+ % place the captured inserts
+ %
+ % BEWARE: when the floats start floating, we have to issue warning
+ % whenever an insert appears inside a float which could possibly
+ % float. --kasal, 26may04
+ %
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \lastsection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
+
+\message{localization,}
+
+% For single-language documents, @documentlanguage is usually given very
+% early, just after @documentencoding. Single argument is the language
+% (de) or locale (de_DE) abbreviation.
+%
+{
+ \catcode`\_ = \active
+ \globaldefs=1
+\parseargdef\documentlanguage{\begingroup
+ \let_=\normalunderscore % normal _ character for filenames
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file by the name they passed if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \documentlanguagetrywithoutunderscore{#1_\finish}%
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+ \endgroup % end raw TeX
+\endgroup}
+%
+% If they passed de_DE, and txi-de_DE.tex doesn't exist,
+% try txi-de.tex.
+%
+\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+}
+}% end of special _ catcode
+%
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? Putting it in the current
+directory should work if nowhere else does.}
+
+% This macro is called from txi-??.tex files; the first argument is the
+% \language name to set (without the "\lang@" prefix), the second and
+% third args are \{left,right}hyphenmin.
+%
+% The language names to pass are determined when the format is built.
+% See the etex.log file created at that time, e.g.,
+% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
+%
+% With TeX Live 2008, etex now includes hyphenation patterns for all
+% available languages. This means we can support hyphenation in
+% Texinfo, at least to some extent. (This still doesn't solve the
+% accented characters problem.)
+%
+\catcode`@=11
+\def\txisetlanguage#1#2#3{%
+ % do not set the language if the name is undefined in the current TeX.
+ \expandafter\ifx\csname lang@#1\endcsname \relax
+ \message{no patterns for #1}%
+ \else
+ \global\language = \csname lang@#1\endcsname
+ \fi
+ % but there is no harm in adjusting the hyphenmin values regardless.
+ \global\lefthyphenmin = #2\relax
+ \global\righthyphenmin = #3\relax
+}
+
+% Helpers for encodings.
+% Set the catcode of characters 128 through 255 to the specified number.
+%
+\def\setnonasciicharscatcode#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \global\catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+\def\setnonasciicharscatcodenonglobal#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+% @documentencoding sets the definition of non-ASCII characters
+% according to the specified encoding.
+%
+\parseargdef\documentencoding{%
+ % Encoding being declared for the document.
+ \def\declaredencoding{\csname #1.enc\endcsname}%
+ %
+ % Supported encodings: names converted to tokens in order to be able
+ % to compare them with \ifx.
+ \def\ascii{\csname US-ASCII.enc\endcsname}%
+ \def\latnine{\csname ISO-8859-15.enc\endcsname}%
+ \def\latone{\csname ISO-8859-1.enc\endcsname}%
+ \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
+ \def\utfeight{\csname UTF-8.enc\endcsname}%
+ %
+ \ifx \declaredencoding \ascii
+ \asciichardefs
+ %
+ \else \ifx \declaredencoding \lattwo
+ \setnonasciicharscatcode\active
+ \lattwochardefs
+ %
+ \else \ifx \declaredencoding \latone
+ \setnonasciicharscatcode\active
+ \latonechardefs
+ %
+ \else \ifx \declaredencoding \latnine
+ \setnonasciicharscatcode\active
+ \latninechardefs
+ %
+ \else \ifx \declaredencoding \utfeight
+ \setnonasciicharscatcode\active
+ \utfeightchardefs
+ %
+ \else
+ \message{Unknown document encoding #1, ignoring.}%
+ %
+ \fi % utfeight
+ \fi % latnine
+ \fi % latone
+ \fi % lattwo
+ \fi % ascii
+}
+
+% A message to be logged when using a character that isn't available
+% the default font encoding (OT1).
+%
+\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
+
+% Take account of \c (plain) vs. \, (Texinfo) difference.
+\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
+
+% First, make active non-ASCII characters in order for them to be
+% correctly categorized when TeX reads the replacement text of
+% macros containing the character definitions.
+\setnonasciicharscatcode\active
+%
+% Latin1 (ISO-8859-1) character definitions.
+\def\latonechardefs{%
+ \gdef^^a0{\tie}
+ \gdef^^a1{\exclamdown}
+ \gdef^^a2{\missingcharmsg{CENT SIGN}}
+ \gdef^^a3{{\pounds}}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\missingcharmsg{YEN SIGN}}
+ \gdef^^a6{\missingcharmsg{BROKEN BAR}}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\copyright}
+ \gdef^^aa{\ordf}
+ \gdef^^ab{\guillemetleft}
+ \gdef^^ac{$\lnot$}
+ \gdef^^ad{\-}
+ \gdef^^ae{\registeredsymbol}
+ \gdef^^af{\={}}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{$\pm$}
+ \gdef^^b2{$^2$}
+ \gdef^^b3{$^3$}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{$\mu$}
+ \gdef^^b6{\P}
+ %
+ \gdef^^b7{$^.$}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{$^1$}
+ \gdef^^ba{\ordm}
+ %
+ \gdef^^bb{\guillemetright}
+ \gdef^^bc{$1\over4$}
+ \gdef^^bd{$1\over2$}
+ \gdef^^be{$3\over4$}
+ \gdef^^bf{\questiondown}
+ %
+ \gdef^^c0{\`A}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\~A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\ringaccent A}
+ \gdef^^c6{\AE}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\`E}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\^E}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\`I}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\"I}
+ %
+ \gdef^^d0{\DH}
+ \gdef^^d1{\~N}
+ \gdef^^d2{\`O}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\~O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\O}
+ \gdef^^d9{\`U}
+ \gdef^^da{\'U}
+ \gdef^^db{\^U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\TH}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\`a}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\~a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\ringaccent a}
+ \gdef^^e6{\ae}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\`e}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\^e}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\`{\dotless i}}
+ \gdef^^ed{\'{\dotless i}}
+ \gdef^^ee{\^{\dotless i}}
+ \gdef^^ef{\"{\dotless i}}
+ %
+ \gdef^^f0{\dh}
+ \gdef^^f1{\~n}
+ \gdef^^f2{\`o}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\~o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\o}
+ \gdef^^f9{\`u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\^u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\th}
+ \gdef^^ff{\"y}
+}
+
+% Latin9 (ISO-8859-15) encoding character definitions.
+\def\latninechardefs{%
+ % Encoding is almost identical to Latin1.
+ \latonechardefs
+ %
+ \gdef^^a4{\euro}
+ \gdef^^a6{\v S}
+ \gdef^^a8{\v s}
+ \gdef^^b4{\v Z}
+ \gdef^^b8{\v z}
+ \gdef^^bc{\OE}
+ \gdef^^bd{\oe}
+ \gdef^^be{\"Y}
+}
+
+% Latin2 (ISO-8859-2) character definitions.
+\def\lattwochardefs{%
+ \gdef^^a0{\tie}
+ \gdef^^a1{\ogonek{A}}
+ \gdef^^a2{\u{}}
+ \gdef^^a3{\L}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\v L}
+ \gdef^^a6{\'S}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\v S}
+ \gdef^^aa{\cedilla S}
+ \gdef^^ab{\v T}
+ \gdef^^ac{\'Z}
+ \gdef^^ad{\-}
+ \gdef^^ae{\v Z}
+ \gdef^^af{\dotaccent Z}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{\ogonek{a}}
+ \gdef^^b2{\ogonek{ }}
+ \gdef^^b3{\l}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{\v l}
+ \gdef^^b6{\'s}
+ \gdef^^b7{\v{}}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{\v s}
+ \gdef^^ba{\cedilla s}
+ \gdef^^bb{\v t}
+ \gdef^^bc{\'z}
+ \gdef^^bd{\H{}}
+ \gdef^^be{\v z}
+ \gdef^^bf{\dotaccent z}
+ %
+ \gdef^^c0{\'R}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\u A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\'L}
+ \gdef^^c6{\'C}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\v C}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\ogonek{E}}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\v E}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\v D}
+ %
+ \gdef^^d0{\DH}
+ \gdef^^d1{\'N}
+ \gdef^^d2{\v N}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\H O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\v R}
+ \gdef^^d9{\ringaccent U}
+ \gdef^^da{\'U}
+ \gdef^^db{\H U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\cedilla T}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\'r}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\u a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\'l}
+ \gdef^^e6{\'c}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\v c}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\ogonek{e}}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\v e}
+ \gdef^^ed{\'{\dotless{i}}}
+ \gdef^^ee{\^{\dotless{i}}}
+ \gdef^^ef{\v d}
+ %
+ \gdef^^f0{\dh}
+ \gdef^^f1{\'n}
+ \gdef^^f2{\v n}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\H o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\v r}
+ \gdef^^f9{\ringaccent u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\H u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\cedilla t}
+ \gdef^^ff{\dotaccent{}}
+}
+
+% UTF-8 character definitions.
+%
+% This code to support UTF-8 is based on LaTeX's utf8.def, with some
+% changes for Texinfo conventions. It is included here under the GPL by
+% permission from Frank Mittelbach and the LaTeX team.
+%
+\newcount\countUTFx
+\newcount\countUTFy
+\newcount\countUTFz
+
+\gdef\UTFviiiTwoOctets#1#2{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\endcsname}
+%
+\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
+%
+\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
+
+\gdef\UTFviiiDefined#1{%
+ \ifx #1\relax
+ \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
+ \else
+ \expandafter #1%
+ \fi
+}
+
+\begingroup
+ \catcode`\~13
+ \catcode`\"12
+
+ \def\UTFviiiLoop{%
+ \global\catcode\countUTFx\active
+ \uccode`\~\countUTFx
+ \uppercase\expandafter{\UTFviiiTmp}%
+ \advance\countUTFx by 1
+ \ifnum\countUTFx < \countUTFy
+ \expandafter\UTFviiiLoop
+ \fi}
+
+ \countUTFx = "C2
+ \countUTFy = "E0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "E0
+ \countUTFy = "F0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "F0
+ \countUTFy = "F4
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiFourOctets\string~}}
+ \UTFviiiLoop
+\endgroup
+
+\begingroup
+ \catcode`\"=12
+ \catcode`\<=12
+ \catcode`\.=12
+ \catcode`\,=12
+ \catcode`\;=12
+ \catcode`\!=12
+ \catcode`\~=13
+
+ \gdef\DeclareUnicodeCharacter#1#2{%
+ \countUTFz = "#1\relax
+ %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+ \begingroup
+ \parseXMLCharref
+ \def\UTFviiiTwoOctets##1##2{%
+ \csname u8:##1\string ##2\endcsname}%
+ \def\UTFviiiThreeOctets##1##2##3{%
+ \csname u8:##1\string ##2\string ##3\endcsname}%
+ \def\UTFviiiFourOctets##1##2##3##4{%
+ \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \gdef\UTFviiiTmp{#2}%
+ \endgroup}
+
+ \gdef\parseXMLCharref{%
+ \ifnum\countUTFz < "A0\relax
+ \errhelp = \EMsimple
+ \errmessage{Cannot define Unicode char value < 00A0}%
+ \else\ifnum\countUTFz < "800\relax
+ \parseUTFviiiA,%
+ \parseUTFviiiB C\UTFviiiTwoOctets.,%
+ \else\ifnum\countUTFz < "10000\relax
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
+ \else
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiA!%
+ \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
+ \fi\fi\fi
+ }
+
+ \gdef\parseUTFviiiA#1{%
+ \countUTFx = \countUTFz
+ \divide\countUTFz by 64
+ \countUTFy = \countUTFz
+ \multiply\countUTFz by 64
+ \advance\countUTFx by -\countUTFz
+ \advance\countUTFx by 128
+ \uccode `#1\countUTFx
+ \countUTFz = \countUTFy}
+
+ \gdef\parseUTFviiiB#1#2#3#4{%
+ \advance\countUTFz by "#10\relax
+ \uccode `#3\countUTFz
+ \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
+\endgroup
+
+\def\utfeightchardefs{%
+ \DeclareUnicodeCharacter{00A0}{\tie}
+ \DeclareUnicodeCharacter{00A1}{\exclamdown}
+ \DeclareUnicodeCharacter{00A3}{\pounds}
+ \DeclareUnicodeCharacter{00A8}{\"{ }}
+ \DeclareUnicodeCharacter{00A9}{\copyright}
+ \DeclareUnicodeCharacter{00AA}{\ordf}
+ \DeclareUnicodeCharacter{00AB}{\guillemetleft}
+ \DeclareUnicodeCharacter{00AD}{\-}
+ \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
+ \DeclareUnicodeCharacter{00AF}{\={ }}
+
+ \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
+ \DeclareUnicodeCharacter{00B4}{\'{ }}
+ \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
+ \DeclareUnicodeCharacter{00BA}{\ordm}
+ \DeclareUnicodeCharacter{00BB}{\guillemetright}
+ \DeclareUnicodeCharacter{00BF}{\questiondown}
+
+ \DeclareUnicodeCharacter{00C0}{\`A}
+ \DeclareUnicodeCharacter{00C1}{\'A}
+ \DeclareUnicodeCharacter{00C2}{\^A}
+ \DeclareUnicodeCharacter{00C3}{\~A}
+ \DeclareUnicodeCharacter{00C4}{\"A}
+ \DeclareUnicodeCharacter{00C5}{\AA}
+ \DeclareUnicodeCharacter{00C6}{\AE}
+ \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
+ \DeclareUnicodeCharacter{00C8}{\`E}
+ \DeclareUnicodeCharacter{00C9}{\'E}
+ \DeclareUnicodeCharacter{00CA}{\^E}
+ \DeclareUnicodeCharacter{00CB}{\"E}
+ \DeclareUnicodeCharacter{00CC}{\`I}
+ \DeclareUnicodeCharacter{00CD}{\'I}
+ \DeclareUnicodeCharacter{00CE}{\^I}
+ \DeclareUnicodeCharacter{00CF}{\"I}
+
+ \DeclareUnicodeCharacter{00D0}{\DH}
+ \DeclareUnicodeCharacter{00D1}{\~N}
+ \DeclareUnicodeCharacter{00D2}{\`O}
+ \DeclareUnicodeCharacter{00D3}{\'O}
+ \DeclareUnicodeCharacter{00D4}{\^O}
+ \DeclareUnicodeCharacter{00D5}{\~O}
+ \DeclareUnicodeCharacter{00D6}{\"O}
+ \DeclareUnicodeCharacter{00D8}{\O}
+ \DeclareUnicodeCharacter{00D9}{\`U}
+ \DeclareUnicodeCharacter{00DA}{\'U}
+ \DeclareUnicodeCharacter{00DB}{\^U}
+ \DeclareUnicodeCharacter{00DC}{\"U}
+ \DeclareUnicodeCharacter{00DD}{\'Y}
+ \DeclareUnicodeCharacter{00DE}{\TH}
+ \DeclareUnicodeCharacter{00DF}{\ss}
+
+ \DeclareUnicodeCharacter{00E0}{\`a}
+ \DeclareUnicodeCharacter{00E1}{\'a}
+ \DeclareUnicodeCharacter{00E2}{\^a}
+ \DeclareUnicodeCharacter{00E3}{\~a}
+ \DeclareUnicodeCharacter{00E4}{\"a}
+ \DeclareUnicodeCharacter{00E5}{\aa}
+ \DeclareUnicodeCharacter{00E6}{\ae}
+ \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
+ \DeclareUnicodeCharacter{00E8}{\`e}
+ \DeclareUnicodeCharacter{00E9}{\'e}
+ \DeclareUnicodeCharacter{00EA}{\^e}
+ \DeclareUnicodeCharacter{00EB}{\"e}
+ \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
+ \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{00F0}{\dh}
+ \DeclareUnicodeCharacter{00F1}{\~n}
+ \DeclareUnicodeCharacter{00F2}{\`o}
+ \DeclareUnicodeCharacter{00F3}{\'o}
+ \DeclareUnicodeCharacter{00F4}{\^o}
+ \DeclareUnicodeCharacter{00F5}{\~o}
+ \DeclareUnicodeCharacter{00F6}{\"o}
+ \DeclareUnicodeCharacter{00F8}{\o}
+ \DeclareUnicodeCharacter{00F9}{\`u}
+ \DeclareUnicodeCharacter{00FA}{\'u}
+ \DeclareUnicodeCharacter{00FB}{\^u}
+ \DeclareUnicodeCharacter{00FC}{\"u}
+ \DeclareUnicodeCharacter{00FD}{\'y}
+ \DeclareUnicodeCharacter{00FE}{\th}
+ \DeclareUnicodeCharacter{00FF}{\"y}
+
+ \DeclareUnicodeCharacter{0100}{\=A}
+ \DeclareUnicodeCharacter{0101}{\=a}
+ \DeclareUnicodeCharacter{0102}{\u{A}}
+ \DeclareUnicodeCharacter{0103}{\u{a}}
+ \DeclareUnicodeCharacter{0104}{\ogonek{A}}
+ \DeclareUnicodeCharacter{0105}{\ogonek{a}}
+ \DeclareUnicodeCharacter{0106}{\'C}
+ \DeclareUnicodeCharacter{0107}{\'c}
+ \DeclareUnicodeCharacter{0108}{\^C}
+ \DeclareUnicodeCharacter{0109}{\^c}
+ \DeclareUnicodeCharacter{0118}{\ogonek{E}}
+ \DeclareUnicodeCharacter{0119}{\ogonek{e}}
+ \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
+ \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
+ \DeclareUnicodeCharacter{010C}{\v{C}}
+ \DeclareUnicodeCharacter{010D}{\v{c}}
+ \DeclareUnicodeCharacter{010E}{\v{D}}
+
+ \DeclareUnicodeCharacter{0112}{\=E}
+ \DeclareUnicodeCharacter{0113}{\=e}
+ \DeclareUnicodeCharacter{0114}{\u{E}}
+ \DeclareUnicodeCharacter{0115}{\u{e}}
+ \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
+ \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
+ \DeclareUnicodeCharacter{011A}{\v{E}}
+ \DeclareUnicodeCharacter{011B}{\v{e}}
+ \DeclareUnicodeCharacter{011C}{\^G}
+ \DeclareUnicodeCharacter{011D}{\^g}
+ \DeclareUnicodeCharacter{011E}{\u{G}}
+ \DeclareUnicodeCharacter{011F}{\u{g}}
+
+ \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
+ \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
+ \DeclareUnicodeCharacter{0124}{\^H}
+ \DeclareUnicodeCharacter{0125}{\^h}
+ \DeclareUnicodeCharacter{0128}{\~I}
+ \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
+ \DeclareUnicodeCharacter{012A}{\=I}
+ \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
+ \DeclareUnicodeCharacter{012C}{\u{I}}
+ \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
+ \DeclareUnicodeCharacter{0131}{\dotless{i}}
+ \DeclareUnicodeCharacter{0132}{IJ}
+ \DeclareUnicodeCharacter{0133}{ij}
+ \DeclareUnicodeCharacter{0134}{\^J}
+ \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
+ \DeclareUnicodeCharacter{0139}{\'L}
+ \DeclareUnicodeCharacter{013A}{\'l}
+
+ \DeclareUnicodeCharacter{0141}{\L}
+ \DeclareUnicodeCharacter{0142}{\l}
+ \DeclareUnicodeCharacter{0143}{\'N}
+ \DeclareUnicodeCharacter{0144}{\'n}
+ \DeclareUnicodeCharacter{0147}{\v{N}}
+ \DeclareUnicodeCharacter{0148}{\v{n}}
+ \DeclareUnicodeCharacter{014C}{\=O}
+ \DeclareUnicodeCharacter{014D}{\=o}
+ \DeclareUnicodeCharacter{014E}{\u{O}}
+ \DeclareUnicodeCharacter{014F}{\u{o}}
+
+ \DeclareUnicodeCharacter{0150}{\H{O}}
+ \DeclareUnicodeCharacter{0151}{\H{o}}
+ \DeclareUnicodeCharacter{0152}{\OE}
+ \DeclareUnicodeCharacter{0153}{\oe}
+ \DeclareUnicodeCharacter{0154}{\'R}
+ \DeclareUnicodeCharacter{0155}{\'r}
+ \DeclareUnicodeCharacter{0158}{\v{R}}
+ \DeclareUnicodeCharacter{0159}{\v{r}}
+ \DeclareUnicodeCharacter{015A}{\'S}
+ \DeclareUnicodeCharacter{015B}{\'s}
+ \DeclareUnicodeCharacter{015C}{\^S}
+ \DeclareUnicodeCharacter{015D}{\^s}
+ \DeclareUnicodeCharacter{015E}{\cedilla{S}}
+ \DeclareUnicodeCharacter{015F}{\cedilla{s}}
+
+ \DeclareUnicodeCharacter{0160}{\v{S}}
+ \DeclareUnicodeCharacter{0161}{\v{s}}
+ \DeclareUnicodeCharacter{0162}{\cedilla{t}}
+ \DeclareUnicodeCharacter{0163}{\cedilla{T}}
+ \DeclareUnicodeCharacter{0164}{\v{T}}
+
+ \DeclareUnicodeCharacter{0168}{\~U}
+ \DeclareUnicodeCharacter{0169}{\~u}
+ \DeclareUnicodeCharacter{016A}{\=U}
+ \DeclareUnicodeCharacter{016B}{\=u}
+ \DeclareUnicodeCharacter{016C}{\u{U}}
+ \DeclareUnicodeCharacter{016D}{\u{u}}
+ \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
+ \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
+
+ \DeclareUnicodeCharacter{0170}{\H{U}}
+ \DeclareUnicodeCharacter{0171}{\H{u}}
+ \DeclareUnicodeCharacter{0174}{\^W}
+ \DeclareUnicodeCharacter{0175}{\^w}
+ \DeclareUnicodeCharacter{0176}{\^Y}
+ \DeclareUnicodeCharacter{0177}{\^y}
+ \DeclareUnicodeCharacter{0178}{\"Y}
+ \DeclareUnicodeCharacter{0179}{\'Z}
+ \DeclareUnicodeCharacter{017A}{\'z}
+ \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
+ \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
+ \DeclareUnicodeCharacter{017D}{\v{Z}}
+ \DeclareUnicodeCharacter{017E}{\v{z}}
+
+ \DeclareUnicodeCharacter{01C4}{D\v{Z}}
+ \DeclareUnicodeCharacter{01C5}{D\v{z}}
+ \DeclareUnicodeCharacter{01C6}{d\v{z}}
+ \DeclareUnicodeCharacter{01C7}{LJ}
+ \DeclareUnicodeCharacter{01C8}{Lj}
+ \DeclareUnicodeCharacter{01C9}{lj}
+ \DeclareUnicodeCharacter{01CA}{NJ}
+ \DeclareUnicodeCharacter{01CB}{Nj}
+ \DeclareUnicodeCharacter{01CC}{nj}
+ \DeclareUnicodeCharacter{01CD}{\v{A}}
+ \DeclareUnicodeCharacter{01CE}{\v{a}}
+ \DeclareUnicodeCharacter{01CF}{\v{I}}
+
+ \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
+ \DeclareUnicodeCharacter{01D1}{\v{O}}
+ \DeclareUnicodeCharacter{01D2}{\v{o}}
+ \DeclareUnicodeCharacter{01D3}{\v{U}}
+ \DeclareUnicodeCharacter{01D4}{\v{u}}
+
+ \DeclareUnicodeCharacter{01E2}{\={\AE}}
+ \DeclareUnicodeCharacter{01E3}{\={\ae}}
+ \DeclareUnicodeCharacter{01E6}{\v{G}}
+ \DeclareUnicodeCharacter{01E7}{\v{g}}
+ \DeclareUnicodeCharacter{01E8}{\v{K}}
+ \DeclareUnicodeCharacter{01E9}{\v{k}}
+
+ \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
+ \DeclareUnicodeCharacter{01F1}{DZ}
+ \DeclareUnicodeCharacter{01F2}{Dz}
+ \DeclareUnicodeCharacter{01F3}{dz}
+ \DeclareUnicodeCharacter{01F4}{\'G}
+ \DeclareUnicodeCharacter{01F5}{\'g}
+ \DeclareUnicodeCharacter{01F8}{\`N}
+ \DeclareUnicodeCharacter{01F9}{\`n}
+ \DeclareUnicodeCharacter{01FC}{\'{\AE}}
+ \DeclareUnicodeCharacter{01FD}{\'{\ae}}
+ \DeclareUnicodeCharacter{01FE}{\'{\O}}
+ \DeclareUnicodeCharacter{01FF}{\'{\o}}
+
+ \DeclareUnicodeCharacter{021E}{\v{H}}
+ \DeclareUnicodeCharacter{021F}{\v{h}}
+
+ \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
+ \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
+ \DeclareUnicodeCharacter{0228}{\cedilla{E}}
+ \DeclareUnicodeCharacter{0229}{\cedilla{e}}
+ \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
+ \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
+
+ \DeclareUnicodeCharacter{0232}{\=Y}
+ \DeclareUnicodeCharacter{0233}{\=y}
+ \DeclareUnicodeCharacter{0237}{\dotless{j}}
+
+ \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
+
+ \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
+ \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
+ \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
+ \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
+ \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
+ \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
+ \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
+ \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
+ \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
+ \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
+ \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
+ \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
+
+ \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
+ \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
+
+ \DeclareUnicodeCharacter{1E20}{\=G}
+ \DeclareUnicodeCharacter{1E21}{\=g}
+ \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
+ \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
+ \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
+ \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
+ \DeclareUnicodeCharacter{1E26}{\"H}
+ \DeclareUnicodeCharacter{1E27}{\"h}
+
+ \DeclareUnicodeCharacter{1E30}{\'K}
+ \DeclareUnicodeCharacter{1E31}{\'k}
+ \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
+ \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
+ \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
+ \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
+ \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
+ \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
+ \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
+ \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
+ \DeclareUnicodeCharacter{1E3E}{\'M}
+ \DeclareUnicodeCharacter{1E3F}{\'m}
+
+ \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
+ \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
+ \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
+ \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
+ \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
+ \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
+ \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
+ \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
+ \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
+ \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
+
+ \DeclareUnicodeCharacter{1E54}{\'P}
+ \DeclareUnicodeCharacter{1E55}{\'p}
+ \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
+ \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
+ \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
+ \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
+ \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
+ \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
+ \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
+ \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
+
+ \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
+ \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
+ \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
+ \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
+ \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
+ \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
+ \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
+ \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
+ \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
+ \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
+
+ \DeclareUnicodeCharacter{1E7C}{\~V}
+ \DeclareUnicodeCharacter{1E7D}{\~v}
+ \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
+ \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
+
+ \DeclareUnicodeCharacter{1E80}{\`W}
+ \DeclareUnicodeCharacter{1E81}{\`w}
+ \DeclareUnicodeCharacter{1E82}{\'W}
+ \DeclareUnicodeCharacter{1E83}{\'w}
+ \DeclareUnicodeCharacter{1E84}{\"W}
+ \DeclareUnicodeCharacter{1E85}{\"w}
+ \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
+ \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
+ \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
+ \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
+ \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
+ \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
+ \DeclareUnicodeCharacter{1E8C}{\"X}
+ \DeclareUnicodeCharacter{1E8D}{\"x}
+ \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
+ \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
+
+ \DeclareUnicodeCharacter{1E90}{\^Z}
+ \DeclareUnicodeCharacter{1E91}{\^z}
+ \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
+ \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
+ \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
+ \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
+ \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
+ \DeclareUnicodeCharacter{1E97}{\"t}
+ \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
+ \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
+
+ \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
+ \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
+
+ \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
+ \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
+ \DeclareUnicodeCharacter{1EBC}{\~E}
+ \DeclareUnicodeCharacter{1EBD}{\~e}
+
+ \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
+ \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
+ \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
+ \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
+
+ \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
+ \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
+
+ \DeclareUnicodeCharacter{1EF2}{\`Y}
+ \DeclareUnicodeCharacter{1EF3}{\`y}
+ \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
+
+ \DeclareUnicodeCharacter{1EF8}{\~Y}
+ \DeclareUnicodeCharacter{1EF9}{\~y}
+
+ \DeclareUnicodeCharacter{2013}{--}
+ \DeclareUnicodeCharacter{2014}{---}
+ \DeclareUnicodeCharacter{2018}{\quoteleft}
+ \DeclareUnicodeCharacter{2019}{\quoteright}
+ \DeclareUnicodeCharacter{201A}{\quotesinglbase}
+ \DeclareUnicodeCharacter{201C}{\quotedblleft}
+ \DeclareUnicodeCharacter{201D}{\quotedblright}
+ \DeclareUnicodeCharacter{201E}{\quotedblbase}
+ \DeclareUnicodeCharacter{2022}{\bullet}
+ \DeclareUnicodeCharacter{2026}{\dots}
+ \DeclareUnicodeCharacter{2039}{\guilsinglleft}
+ \DeclareUnicodeCharacter{203A}{\guilsinglright}
+ \DeclareUnicodeCharacter{20AC}{\euro}
+
+ \DeclareUnicodeCharacter{2192}{\expansion}
+ \DeclareUnicodeCharacter{21D2}{\result}
+
+ \DeclareUnicodeCharacter{2212}{\minus}
+ \DeclareUnicodeCharacter{2217}{\point}
+ \DeclareUnicodeCharacter{2261}{\equiv}
+}% end of \utfeightchardefs
+
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+ \relax
+}
+
+% Make non-ASCII characters printable again for compatibility with
+% existing Texinfo documents that may use them, even without declaring a
+% document encoding.
+%
+\setnonasciicharscatcode \other
+
+
+\message{formatting,}
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
+
+% Following George Bush, get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading. The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ % if we don't reset these, they will remain at "1 true in" of
+ % whatever layout pdftex was dumped with.
+ \pdfhorigin = 1 true in
+ \pdfvorigin = 1 true in
+ \fi
+ %
+ \setleading{\textleading}
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{607.2pt}{6in}% that's 46 lines
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {-.2in}{0in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+ \parskip = 1.5pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.4in}{4.8in}%
+ {-.2in}{-.4in}%
+ {0pt}{14pt}%
+ {9in}{6in}%
+ %
+ \lispnarrowing = 0.25in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{673.2pt}{160mm}% that's 51 lines
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1\relax
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
+% DEL is a comment character, in case @c does not suffice.
+\catcode`\^^? = 14
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+% Used sometimes to turn off (effectively) the active characters even after
+% parsing them.
+\def\turnoffactive{%
+ \normalturnoffactive
+ \otherbackslash
+}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% In texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active % @ for escape char from now on.
+
+% The story here is that in math mode, the \char of \backslashcurfont
+% ends up printing the roman \ from the math symbol font (because \char
+% in math mode uses the \mathcode, and plain.tex sets
+% \mathcode`\\="026E). It seems better for @backslashchar{} to always
+% print a typewriter backslash, hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C). We can't use " for the
+% usual hex value because it has already been made active.
+@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
+
+% On startup, @fixbackslash assigns:
+% @let \ = @normalbackslash
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other. We switch back and forth between these.
+@gdef@rawbackslash{@let\=@backslashcurfont}
+@gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'. Also revert - to its normal character, in
+% case the active - from code has slipped in.
+%
+{@catcode`- = @active
+ @gdef@normalturnoffactive{%
+ @let-=@normaldash
+ @let"=@normaldoublequote
+ @let$=@normaldollar %$ font-lock fix
+ @let+=@normalplus
+ @let<=@normalless
+ @let>=@normalgreater
+ @let\=@normalbackslash
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let~=@normaltilde
+ @markupsetuplqdefault
+ @markupsetuprqdefault
+ @unsepspaces
+ }
+}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\' in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+@def@normaldot{.}
+@def@normalquest{?}
+@def@normalslash{/}
+
+% These look ok in all fonts, so just make them not special.
+% @hashchar{} gets its own user-level command, because of #line.
+@catcode`@& = @other @def@normalamp{&}
+@catcode`@# = @other @def@normalhash{#}
+@catcode`@% = @other @def@normalpercent{%}
+
+@let @hashchar = @normalhash
+
+@c Finally, make ` and ' active, so that txicodequoteundirected and
+@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
+@c don't make ` and ' active, @code will not get them as active chars.
+@c Do this last of all since we use ` in the previous @catcode assignments.
+@catcode`@'=@active
+@catcode`@`=@active
+@markupsetuplqdefault
+@markupsetuprqdefault
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
diff --git a/aux-build/ylwrap b/aux-build/ylwrap
new file mode 100755
index 0000000..8f072a8
--- /dev/null
+++ b/aux-build/ylwrap
@@ -0,0 +1,247 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2013-01-12.17; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+get_dirname ()
+{
+ case $1 in
+ */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+ # Otherwise, we want the empty string (not ".").
+ esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard ()
+{
+ printf '%s\n' "$1" \
+ | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
+ -e 's/__*/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+ case $# in
+ 0) cat;;
+ 1) printf '%s\n' "$1";;
+ esac \
+ | sed -e 's|[][\\.*]|\\&|g'
+}
+
+case "$1" in
+ '')
+ echo "$0: No files given. Try '$0 --help' for more information." 1>&2
+ exit 1
+ ;;
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ -h|--h*)
+ cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+ INPUT is the input file
+ OUTPUT is one file PROG generates
+ DESIRED is the file we actually want instead of OUTPUT
+ PROGRAM is program to run
+ ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--v*)
+ echo "ylwrap $scriptversion"
+ exit $?
+ ;;
+esac
+
+
+# The input.
+input=$1
+shift
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
+case $input in
+ [\\/]* | ?:[\\/]*)
+ # Absolute path; do nothing.
+ ;;
+ *)
+ # Relative path. Make it absolute.
+ input=`pwd`/$input
+ ;;
+esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# Since DOS filename conventions don't allow two dots,
+# the DOS version of Bison writes out y_tab.c instead of y.tab.c
+# and y_tab.h instead of y.tab.h. Test to see if this is the case.
+y_tab_nodot=false
+if test -f y_tab.c || test -f y_tab.h; then
+ y_tab_nodot=true
+fi
+
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
+
+while test $# -ne 0; do
+ if test x"$1" = x"--"; then
+ shift
+ break
+ fi
+ from=$1
+ # Handle y_tab.c and y_tab.h output by DOS
+ if $y_tab_nodot; then
+ case $from in
+ "y.tab.c") from=y_tab.c;;
+ "y.tab.h") from=y_tab.h;;
+ esac
+ fi
+ shift
+ to=$1
+ shift
+ sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+ sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
+done
+
+# The program to run.
+prog=$1
+shift
+# Make any relative path in $prog absolute.
+case $prog in
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog=`pwd`/$prog ;;
+esac
+
+dirname=ylwrap$$
+do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
+trap "ret=129; $do_exit" 1
+trap "ret=130; $do_exit" 2
+trap "ret=141; $do_exit" 13
+trap "ret=143; $do_exit" 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+ 0) "$prog" "$input" ;;
+ *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+ for from in *
+ do
+ to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
+ if test -f "$from"; then
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend '../'.
+ case $to in
+ [\\/]* | ?:[\\/]*) target=$to;;
+ *) target=../$to;;
+ esac
+
+ # Do not overwrite unchanged header files to avoid useless
+ # recompilations. Always update the parser itself: it is the
+ # destination of the .y.c rule in the Makefile. Divert the
+ # output of all other files to a temporary file so we can
+ # compare them to existing versions.
+ if test $from != $parser; then
+ realtarget=$target
+ target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
+ fi
+
+ # Munge "#line" or "#" directives. Don't let the resulting
+ # debug information point at an absolute srcdir. Use the real
+ # output file name, not yy.lex.c for instance. Adjust the
+ # include guards too.
+ sed -e "/^#/!b" \
+ -e "s|$input_rx|$input_sub_rx|" \
+ -e "$sed_fix_filenames" \
+ -e "$sed_fix_header_guards" \
+ "$from" >"$target" || ret=$?
+
+ # Check whether files must be updated.
+ if test "$from" != "$parser"; then
+ if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+ echo "$to is unchanged"
+ rm -f "$target"
+ else
+ echo "updating $to"
+ mv -f "$target" "$realtarget"
+ fi
+ fi
+ else
+ # A missing file is only an error for the parser. This is a
+ # blatant hack to let us support using "yacc -d". If -d is not
+ # specified, don't fail when the header file is "missing".
+ if test "$from" = "$parser"; then
+ ret=1
+ fi
+ fi
+ done
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..6181ba5
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,163 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(libconfig, 1.7.3, hyperrealm@gmail.com, libconfig,
+ [https://hyperrealm.github.io/libconfig/])
+AC_CONFIG_AUX_DIR([aux-build])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE
+AC_CONFIG_HEADERS(ac_config.h)
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_MSG_NOTICE([libconfig - made with pride in Colorado])
+sleep 3
+
+AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
+
+# Enable GNU extensions.
+AC_GNU_SOURCE
+
+LT_INIT()
+
+dnl Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_LIBTOOL_WIN32_DLL
+AC_PROG_LIBTOOL
+
+AM_PROG_LEX
+if test Z"$LEX" != Zflex; then
+cat <<EOF
+*******************************************************************
+You do not seem to have flex. While flex is not required to build
+libconfig, you may need it to regenerate the lexer if you change
+the scanner.l file.
+*******************************************************************
+EOF
+fi
+
+AC_PROG_YACC
+if test Z"$YACC" != "Zbison -y"; then
+cat <<EOF
+*******************************************************************
+You do not seem to have bison. While bison is not required to build
+libconfig, you may need it to regenerate the parser if you change
+the grammar.y file.
+*******************************************************************
+EOF
+fi
+
+AC_MSG_CHECKING([for compiler switch to enable full C/C++ warnings]);
+
+dnl Checks for libraries
+
+dnl Enable warnings, if we can determine an appropriate switch...
+case "${CC}" in
+
+gcc)
+ warn_c_sw="-Wall -Wshadow -Wextra -Wdeclaration-after-statement -Wno-unused-parameter"
+ warn_cxx_sw="-Wall -Wshadow -Wextra -Wno-unused-parameter";;
+*)
+ warn_cxx_sw=""
+ warn_c_sw="";;
+esac
+
+if test -n "${warn_c_sw}";
+then
+ CFLAGS="${CFLAGS} ${warn_c_sw}";
+ CXXFLAGS="${CXXFLAGS} ${warn_cxx_sw}";
+ AC_MSG_RESULT([${warn_c_sw}, ${warn_cxx_sw}])
+else
+ AC_MSG_RESULT([(cannot determine)])
+fi;
+
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h stdint.h xlocale.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+
+dnl Checks for functions
+
+AC_CHECK_FUNCS([newlocale uselocale freelocale])
+
+dnl Package options
+
+docxx=yes
+
+AC_ARG_ENABLE(cxx,
+AS_HELP_STRING([--disable-cxx], [Disable building of the C++ library]),
+[if test "$enableval" = "no"; then docxx="no"; fi],
+[
+docxx=yes
+]
+)
+
+AM_CONDITIONAL(BUILDCXX, test x$docxx = xyes)
+
+dodoc=yes
+
+AC_ARG_ENABLE(doc,
+AS_HELP_STRING([--disable-doc], [Disable building of the documentation]),
+[if test "$enableval" = "no"; then dodoc="no"; fi],
+[
+dodoc=yes
+]
+)
+
+AM_CONDITIONAL(BUILDDOC, test x$dodoc = xyes)
+
+doexamples=yes
+
+AC_ARG_ENABLE(examples,
+AS_HELP_STRING([--disable-examples], [Disable building of the example programs]),
+[if test "$enableval" = "no"; then doexamples="no"; fi],
+[
+doexamples=yes
+]
+)
+
+AM_CONDITIONAL(BUILDEXAMPLES, test x$doexamples = xyes)
+
+dotests=yes
+
+AC_ARG_ENABLE(tests,
+AS_HELP_STRING([--disable-tests], [Disable building of the tests]),
+[if test "$enableval" = "no"; then dotests="no"; fi],
+[
+dotests=yes
+]
+)
+
+AM_CONDITIONAL(BUILDTESTS, test x$dotests = xyes)
+
+dnl Check for MinGW. Workaround for libtool's DLL_EXPORT stupidity.
+
+case "$target" in
+ *-*-cygwin* | *-*-mingw*)
+ gnuwin=yes;;
+esac
+
+AM_CONDITIONAL(GNU_WIN, test x$gnuwin = xyes)
+
+dnl Checks for library functions.
+
+AC_OUTPUT(
+ Makefile
+ lib/Makefile
+ lib/libconfig.pc
+ lib/libconfig++.pc
+ lib/libconfigConfig.cmake
+ lib/libconfig++Config.cmake
+ doc/Makefile
+ examples/Makefile
+ examples/c/Makefile
+ examples/c++/Makefile
+ tinytest/Makefile
+ tests/Makefile
+ libconfig.spec
+ )
diff --git a/contrib/README b/contrib/README
new file mode 100644
index 0000000..7437f0c
--- /dev/null
+++ b/contrib/README
@@ -0,0 +1,3 @@
+These files are not maintained by me; they are user
+contributions. They are not guaranteed to work with this release of
+libconfig.
diff --git a/contrib/chained/README.md b/contrib/chained/README.md
new file mode 100644
index 0000000..9a7ebea
--- /dev/null
+++ b/contrib/chained/README.md
@@ -0,0 +1,60 @@
+# Method Chained libconfig #
+
+**Exception free + header only + method chained + config files**
+
+Provides reading the configuration and defining the configuration specification at once.
+
+### Features ###
+
+ * default values
+ * limits (min/max)
+ * mandatory/optional values
+ * help text output for expected config format on specification violation
+ * capturing and outputting expected configuration specification/defaults
+
+While it is possible to write a config file with this extension using the configuration specification capturing feature, it is not intended to be used as a full fledged config writer.
+
+### Example ###
+
+```C++
+#include <libconfig_chained.h>
+
+using namespace std;
+using namespace libconfig;
+
+int main(int argc, char **argv)
+{
+ Config cfg;
+ cfg.readFile("example.cfg");
+ ChainedSetting cs(cfg.getRoot());
+
+ string name = cs["name"].defaultValue("<name>").isMandatory();
+ string abstract = cs["abstract"].defaultValue("<unknown>");
+ double longitude = cs["longitude"].min(-180.0).max(180.0).isMandatory();
+ double latitude = cs["latitude"].min(-90.0).max(90.0).isMandatory();
+
+ if (cs.isAnyMandatorySettingMissing())
+ {
+ cerr << "Cannot proceed until all mandatory settings are set." << endl;
+ }
+}
+```
+
+Console Output:
+```sh
+'longitude' setting is out of valid bounds (max: 180). Value was: 1200.35
+Missing 'latitude' setting in configuration file.
+Cannot proceed until all mandatory settings are set.
+```
+
+---
+
+### How to integrate into your project ###
+
+ 1. Link the libconfig++.[lib/la/a] library as usual (see standard use of libconfig++).
+ * Replace any includes of libconfig.h++ by libconfig_chained.h.
+ * Use method chained candy as displayed above.
+
+---
+
+Create an issue for any questions or suggestions. Alternatively email me at github [at) hemofektik.de \ No newline at end of file
diff --git a/contrib/chained/examples/CMakeLists.txt b/contrib/chained/examples/CMakeLists.txt
new file mode 100644
index 0000000..936c2b3
--- /dev/null
+++ b/contrib/chained/examples/CMakeLists.txt
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 2.8)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/")
+
+project (ChainedLibconfigExample)
+file(GLOB SOURCES *.cpp *.h ../*.h ../*.md)
+
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+else()
+ find_package(libconfig)
+endif()
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ #set(CMAKE_BUILD_TYPE Debug)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+endif()
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/../../../lib/
+)
+
+if(MSVC)
+ link_libraries (
+ ${CMAKE_SOURCE_DIR}/../../../Debug/libconfig++.lib
+ )
+else()
+link_libraries (
+ ${LIBCONFIG_LIBRARY}
+)
+endif()
+
+
+add_executable (
+ ChainedLibconfigExample
+# WIN32 # Only if you don't want the DOS prompt to appear in the background in Windows
+# MACOSX_BUNDLE
+ ${SOURCES} # We could've listed the source files here directly instead of using a variable to store them
+ #${INCLUDES}
+)
diff --git a/contrib/chained/examples/CreateProjectFiles.bat b/contrib/chained/examples/CreateProjectFiles.bat
new file mode 100644
index 0000000..b306ea1
--- /dev/null
+++ b/contrib/chained/examples/CreateProjectFiles.bat
@@ -0,0 +1,7 @@
+@echo off
+rmdir sln /S/Q
+mkdir sln
+cd sln
+cmake -G "Visual Studio 15 2017" ..
+
+pause \ No newline at end of file
diff --git a/contrib/chained/examples/README.md b/contrib/chained/examples/README.md
new file mode 100644
index 0000000..bab629b
--- /dev/null
+++ b/contrib/chained/examples/README.md
@@ -0,0 +1,43 @@
+
+### Running the examples ###
+
+Expected Console Output:
+
+```C++
+<<< Example 1 >>>
+
+'longitude' setting is out of valid bounds (max: 180). Value was: 1200.35
+Missing 'latitude' setting in configuration file.
+Cannot proceed until all mandatory settings are set.
+
+
+<<< Example 2 >>>
+
+TITLE AUTHOR PRICE QTY
+Treasure Island Robert Louis Stevenson $ 29.99 5
+Snow Crash Neal Stephenson $ 9.99 8
+
+
+<<< Example 3 >>>
+
+'longitude' setting is out of valid bounds (max: 180). Value was: 1200.35
+Missing 'latitude' setting in configuration file.
+Cannot proceed until all mandatory settings are set.
+
+Expected Config Layout:
+
+// -- begin --
+name = "<name>";
+abstract = "<unknown>";
+longitude = 0.0;
+latitude = 0.0;
+inventory =
+{
+ movies = ( );
+ books = (
+ {
+ title = "bookXYZ";
+ } );
+};
+// --- end ---
+``` \ No newline at end of file
diff --git a/contrib/chained/examples/example.cfg b/contrib/chained/examples/example.cfg
new file mode 100644
index 0000000..f3c6c3a
--- /dev/null
+++ b/contrib/chained/examples/example.cfg
@@ -0,0 +1,52 @@
+// An example configuration file that stores information about a store.
+
+// Basic store information:
+name = "Books, Movies & More";
+longitude = 1200.345678;
+
+// Store inventory:
+inventory =
+{
+ books = ( { title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.99;
+ qty = 5; },
+ { title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8; },
+ { title = "Das Kapital";
+ price = 0.0;
+ qty = 100000; }
+ );
+
+ movies = ( { title = "Brazil";
+ media = "DVD";
+ price = 19.99;
+ qty = 11; },
+ { title = "The City of Lost Children";
+ media = "DVD";
+ price = 18.99;
+ qty = 5; },
+ { title = "Memento";
+ media = "Blu-Ray";
+ price = 24.99;
+ qty = 20;
+ },
+ { title = "Howard the Duck"; }
+ );
+};
+
+// Store hours:
+hours =
+{
+ mon = { open = 9; close = 18; };
+ tue = { open = 9; close = 18; };
+ wed = { open = 9; close = 18; };
+ thu = { open = 9; close = 18; };
+ fri = { open = 9; close = 20; };
+ sat = { open = 9; close = 20; };
+ sun = { open = 11; close = 16; };
+};
+
+lost_bag = ( 1234.5678, "Napkin", [1, 2, 3] );
diff --git a/contrib/chained/examples/example1.cpp b/contrib/chained/examples/example1.cpp
new file mode 100644
index 0000000..593bbd6
--- /dev/null
+++ b/contrib/chained/examples/example1.cpp
@@ -0,0 +1,52 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ libconfig chained - Extension for reading the configuration and defining
+ the configuration specification at once.
+ Copyright (C) 2016 Richard Schubert
+
+ This file is part of libconfig contributions.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include "../libconfig_chained.h"
+
+using namespace std;
+using namespace libconfig;
+
+// This example reads basic information from config file
+// and reacts on missing mandatory values.
+
+void example1(Config& cfg)
+{
+ ChainedSetting cs(cfg.getRoot());
+
+ string name = cs["name"].defaultValue("<name>").isMandatory();
+ string abstract = cs["abstract"].defaultValue("<unknown>");
+ double longitude = cs["longitude"].min(-180.0).max(180.0).isMandatory();
+ double latitude = cs["latitude"].min(-90.0).max(90.0).isMandatory();
+
+ if (cs.isAnyMandatorySettingMissing())
+ {
+ cerr << "Cannot proceed until all mandatory settings are set." << endl;
+ return;
+ }
+
+ // from here on all read config values are valid
+}
diff --git a/contrib/chained/examples/example2.cpp b/contrib/chained/examples/example2.cpp
new file mode 100644
index 0000000..6ff227d
--- /dev/null
+++ b/contrib/chained/examples/example2.cpp
@@ -0,0 +1,71 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ libconfig chained - Extension for reading the configuration and defining
+ the configuration specification at once.
+ Copyright (C) 2016 Richard Schubert
+
+ This file is part of libconfig contributions.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include "../libconfig_chained.h"
+
+using namespace std;
+using namespace libconfig;
+
+// This example reads complex types from config file using method chains.
+
+void example2(Config& cfg)
+{
+ ChainedSetting cs(cfg.getRoot());
+
+ auto books = cs["inventory"]["books"];
+ if (!books.exists())
+ {
+ cerr << "No book section available." << endl;
+ return;
+ }
+
+ cout << setw(30) << left << "TITLE" << " "
+ << setw(30) << left << "AUTHOR" << " "
+ << setw(6) << left << "PRICE" << " "
+ << "QTY"
+ << endl;
+
+ const int count = books.getLength();
+ for(int i = 0; i < count; ++i)
+ {
+ auto book = books[i];
+
+ string title = book["title"];
+ string author = book["author"];
+ double price = book["price"].min(0.0);
+ int qty = book["qty"].min(0);
+
+ // Only output the record if all of the expected fields are present.
+ if(book.isAnySettingMissing()) continue;
+
+ cout << setw(30) << left << title << " "
+ << setw(30) << left << author << " "
+ << '$' << setw(6) << right << price << " "
+ << qty
+ << endl;
+ }
+}
diff --git a/contrib/chained/examples/example3.cpp b/contrib/chained/examples/example3.cpp
new file mode 100644
index 0000000..52d0e32
--- /dev/null
+++ b/contrib/chained/examples/example3.cpp
@@ -0,0 +1,66 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ libconfig chained - Extension for reading the configuration and defining
+ the configuration specification at once.
+ Copyright (C) 2016 Richard Schubert
+
+ This file is part of libconfig contributions.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include "../libconfig_chained.h"
+
+using namespace std;
+using namespace libconfig;
+
+// This example reads basic information from config file
+// and prints out the expected configuration specification.
+
+void example3(Config& cfg)
+{
+ ChainedSetting cs(cfg.getRoot());
+
+ Config tmpCfgSpec;
+ tmpCfgSpec.setOptions(Config::OptionOpenBraceOnSeparateLine | Config::OptionSemicolonSeparators);
+ tmpCfgSpec.setTabWidth(3);
+ cs.captureExpectedSpecification(&tmpCfgSpec);
+
+ string name = cs["name"].defaultValue("<name>").isMandatory();
+ string abstract = cs["abstract"].defaultValue("<unknown>");
+ double longitude = cs["longitude"].min(-180.0).max(180.0).isMandatory();
+ double latitude = cs["latitude"].min(-90.0).max(90.0).isMandatory();
+
+ ChainedSetting movie0 = cs["inventory"]["movies"][0];
+ string book0tile = cs["inventory"]["books"][0]["title"].defaultValue("bookXYZ");
+
+ if (cs.isAnyMandatorySettingMissing())
+ {
+ cerr << "Cannot proceed until all mandatory settings are set." << endl << endl;
+
+ auto cfgSpec = cs.getCapturedSpecification("tmpCfgSpec.cfg");
+ cerr << "Expected Config Layout: " << endl << endl;
+ cerr << "// -- begin --" << endl;
+ cerr << cfgSpec;
+ cerr << "// --- end ---" << endl << endl;
+ return;
+ }
+
+ // from here on all read config values are valid
+}
diff --git a/contrib/chained/examples/examples.cpp b/contrib/chained/examples/examples.cpp
new file mode 100644
index 0000000..ca2ba2d
--- /dev/null
+++ b/contrib/chained/examples/examples.cpp
@@ -0,0 +1,69 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ libconfig chained - Extension for reading the configuration and defining
+ the configuration specification at once.
+ Copyright (C) 2016 Richard Schubert
+
+ This file is part of libconfig contributions.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include <libconfig.h++>
+
+using namespace std;
+using namespace libconfig;
+
+// This is the main entry point for all examples.
+// The examples will be called consecutively.
+
+void example1(Config& cfg);
+void example2(Config& cfg);
+void example3(Config& cfg);
+
+int main(int argc, char **argv)
+{
+ Config cfg;
+
+ // Read the file. If there is an error, report it and exit.
+ try
+ {
+ cfg.readFile("../example.cfg");
+ }
+ catch(const FileIOException&)
+ {
+ std::cerr << "I/O error while reading file. " << std::endl;
+ return(EXIT_FAILURE);
+ }
+ catch(const ParseException& pex)
+ {
+ std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine()
+ << " - " << pex.getError() << std::endl;
+ return(EXIT_FAILURE);
+ }
+
+ cout << endl << endl << "<<< Example 1 >>>" << endl << endl;
+ example1(cfg);
+ cout << endl << endl << "<<< Example 2 >>>" << endl << endl;
+ example2(cfg);
+ cout << endl << endl << "<<< Example 3 >>>" << endl << endl;
+ example3(cfg);
+
+ return(EXIT_SUCCESS);
+}
diff --git a/contrib/chained/libconfig_chained.h b/contrib/chained/libconfig_chained.h
new file mode 100644
index 0000000..3ff2b46
--- /dev/null
+++ b/contrib/chained/libconfig_chained.h
@@ -0,0 +1,542 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ libconfig chained - Extension for reading the configuration and defining
+ the configuration specification at once.
+ Copyright (C) 2016 Richard Schubert
+
+ This file is part of libconfig contributions.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#pragma once
+#ifndef _CHAINED_LIBCONFIG_H_
+#define _CHAINED_LIBCONFIG_H_
+
+#include <libconfig.h++>
+#include <cassert>
+#include <fstream>
+#include <sstream>
+#include <iostream>
+
+namespace libconfig
+{
+ class ChainedSetting
+ {
+ struct Variant
+ {
+ private:
+ bool isSet;
+ Setting::Type type;
+
+ bool value_bool;
+ int64_t value_int;
+ double value_float;
+ std::string value_string;
+
+ public:
+
+ Variant()
+ : isSet(false)
+ , type(Setting::TypeNone)
+ {
+ }
+ Variant(bool value)
+ {
+ value_bool = value;
+ isSet = true;
+ type = Setting::TypeBoolean;
+ }
+ Variant(int32_t value)
+ {
+ value_int = value;
+ isSet = true;
+ type = Setting::TypeInt;
+ }
+ Variant(int64_t value)
+ {
+ value_int = value;
+ isSet = true;
+ type = Setting::TypeInt64;
+ }
+ Variant(double value)
+ {
+ value_float = value;
+ isSet = true;
+ type = Setting::TypeFloat;
+ }
+ Variant(std::string& value)
+ {
+ value_string = value;
+ isSet = true;
+ type = Setting::TypeString;
+ }
+ Variant(const char* value)
+ {
+ value_string = value;
+ isSet = true;
+ type = Setting::TypeString;
+ }
+
+ operator bool() const { return value_bool; }
+ operator int() const { return (int)value_int; }
+ operator unsigned int() const { return (unsigned int)value_int; }
+ operator long() const { return (long)value_int; }
+ operator unsigned long() const { return (unsigned long)value_int; }
+ operator long long() const { return (long long)value_int; }
+ operator unsigned long long() const { return (unsigned long long)value_int; }
+ operator double() const { return value_float; }
+ operator float() const { return (float)value_float; }
+ operator std::string() const { return value_string; }
+
+ const bool IsSet() const
+ {
+ return isSet;
+ }
+
+ const Setting::Type GetType() const
+ {
+ return type;
+ }
+ };
+
+ public:
+
+ // Starting point for method chained libconfig.
+ // Pass a custom ostream to intercept any error messages (useful for Applications with UI).
+ ChainedSetting(Setting& setting, std::ostream& err = std::cerr)
+ : name(setting.isRoot() ? "<root>" : (setting.getName() ? setting.getName() : ""))
+ , index(setting.getIndex())
+ , parent(NULL)
+ , setting(&setting)
+ , err(err)
+ , isSettingMandatory(false)
+ , anySettingIsMissing(false)
+ , anyMandatorySettingIsMissing(false)
+ , capturedSpecification(NULL)
+ , capturedSetting(NULL)
+ {
+ }
+
+ // Starts capturing any configuration readings into the temporary config object.
+ void captureExpectedSpecification(Config* temporaryConfigSpecification)
+ {
+ capturedSpecification = temporaryConfigSpecification;
+ capturedSetting = &capturedSpecification->getRoot();
+ }
+
+ // Returns the captured configuration specification,
+ // premised captureExpectedSpecification() was called earlier.
+ // The path parameter is needed to write the configuration
+ // to disk before it can be read into a usable string.
+ std::string getCapturedSpecification(const std::string& tempFilePath)
+ {
+ try
+ {
+ capturedSpecification->writeFile(tempFilePath.c_str());
+ }
+ catch (const FileIOException&)
+ {
+ err << "I/O error while writing temporary setting file: " << tempFilePath << std::endl;
+ return "";
+ }
+
+ std::ifstream t(tempFilePath);
+ if (!t.is_open())
+ {
+ err << "I/O error while reading temporary setting file: " << tempFilePath << std::endl;
+ return "";
+ }
+ std::stringstream buffer;
+ buffer << t.rdbuf();
+
+ capturedSpecification = NULL;
+
+ return buffer.str();
+ }
+
+ // Defines the default value for this setting if missing from config file.
+ template<typename T>
+ ChainedSetting& defaultValue(T defaultValue)
+ {
+ defaultVal = defaultValue;
+ return *this;
+ }
+
+ // Defines the inclusive minimum value for this setting.
+ // A lesser value set in a configuration file will be clamped to this limit.
+ template<typename T>
+ ChainedSetting& min(T min)
+ {
+ minVal = min;
+ return *this;
+ }
+
+ // Defines the inclusive maximum value for this setting.
+ // A greater value set in a configuration file will be clamped to this limit.
+ template<typename T>
+ ChainedSetting& max(T max)
+ {
+ maxVal = max;
+ return *this;
+ }
+
+ // Defines this setting to be mandatory.
+ // Any mandatory value missing in the configuration file will raise an error.
+ // Use isAnyMandatorySettingMissing() to check for any violations.
+ ChainedSetting& isMandatory()
+ {
+ isSettingMandatory = true;
+ if (parent) parent->isMandatory();
+ return *this;
+ }
+
+ template<typename T>
+ operator T()
+ {
+ auto requestedType = GetRequestedType<T>();
+ CheckType(defaultVal, requestedType);
+ CheckType(minVal, requestedType);
+ CheckType(maxVal, requestedType);
+
+ CaptureSetting<T>(requestedType);
+
+ if (!setting)
+ {
+ if (isSettingMandatory)
+ {
+ AlertMandatorySettingMissing<T>();
+ }
+ PropagateAnySettingIsMissing();
+
+ return GetDefaultValue<T>();
+ }
+
+ try
+ {
+ T value = *setting;
+ if (minVal.IsSet())
+ {
+ T min = minVal;
+ if (value < min)
+ {
+ err << "'" << setting->getPath() << "' setting is out of valid bounds (min: " << min << "). Value was: " << value << std::endl;
+ value = min;
+ }
+ }
+ if (maxVal.IsSet())
+ {
+ T max = maxVal;
+ if (value > max)
+ {
+ err << "'" << setting->getPath() << "' setting is out of valid bounds (max: " << max << "). Value was: " << value << std::endl;
+ value = max;
+ }
+ }
+ return value;
+ }
+ catch (const SettingTypeException& tex)
+ {
+ err << "'" << tex.getPath() << "' setting is of wrong type." << std::endl;
+ }
+
+ return GetDefaultValue<T>();
+ }
+
+ ChainedSetting operator[](const char *name)
+ {
+ CaptureSetting<Setting>(Setting::TypeGroup);
+
+ if (!setting)
+ {
+ return ChainedSetting(name, this);
+ }
+
+ if(setting->exists(name))
+ {
+ return ChainedSetting((*setting)[name], this);
+ }
+ else
+ {
+ return ChainedSetting(name, this);
+ }
+ }
+
+ inline ChainedSetting operator[](const std::string &name)
+ {
+ return(operator[](name.c_str()));
+ }
+
+ ChainedSetting operator[](int index)
+ {
+ // This could also be an TypeArray but we cannot be sure here.
+ // By using TypeList we ensure it will always work.
+ CaptureSetting<Setting>(Setting::TypeList);
+
+ if (!setting)
+ {
+ return ChainedSetting(index, this);
+ }
+
+ if (index >= 0 && index < setting->getLength())
+ {
+ return ChainedSetting((*setting)[index], this);
+ }
+ else
+ {
+ return ChainedSetting(index, this);
+ }
+ }
+
+ int getLength() const
+ {
+ return setting ? setting->getLength() : 0;
+ }
+
+ Setting::Type getType() const
+ {
+ return setting ? setting->getType() : Setting::TypeNone;
+ }
+
+ // Indicates whether this setting is present in the read configuration file.
+ bool exists() const
+ {
+ return setting != NULL;
+ }
+
+ bool isAnyMandatorySettingMissing() const
+ {
+ return anyMandatorySettingIsMissing;
+ }
+
+ bool isAnySettingMissing() const
+ {
+ return anySettingIsMissing;
+ }
+
+ void clearAnySettingMissingFlag()
+ {
+ anySettingIsMissing = false;
+ }
+
+ private:
+
+ ChainedSetting(Setting& setting, ChainedSetting* parent)
+ : name(setting.isRoot() ? "<root>" : (setting.getName() ? setting.getName() : ""))
+ , index(setting.getIndex())
+ , parent(parent)
+ , setting(&setting)
+ , err(parent->err)
+ , isSettingMandatory(false)
+ , anySettingIsMissing(false)
+ , anyMandatorySettingIsMissing(false)
+ , capturedSpecification(NULL)
+ , capturedSetting(NULL)
+ {
+ }
+
+ ChainedSetting(const std::string& name, ChainedSetting* parent)
+ : name(name)
+ , index(-1)
+ , parent(parent)
+ , setting(NULL)
+ , err(parent->err)
+ , isSettingMandatory(false)
+ , anySettingIsMissing(true)
+ , anyMandatorySettingIsMissing(false)
+ , capturedSpecification(NULL)
+ , capturedSetting(NULL)
+ {
+ }
+
+ ChainedSetting(int index, ChainedSetting* parent)
+ : name("")
+ , index(index)
+ , parent(parent)
+ , setting(NULL)
+ , err(parent->err)
+ , isSettingMandatory(false)
+ , anySettingIsMissing(true)
+ , anyMandatorySettingIsMissing(false)
+ , capturedSpecification(NULL)
+ , capturedSetting(NULL)
+ {
+ }
+
+ template<typename T>
+ void ConditionalSetCapturedDefaultValue()
+ {
+ *capturedSetting = GetDefaultValue<T>();
+ }
+
+
+
+ template<typename T>
+ void CaptureSetting(Setting::Type type)
+ {
+ if (!capturedSetting && parent && parent->capturedSetting)
+ {
+ if (name.length() > 0)
+ {
+ if (!parent->capturedSetting->exists(name))
+ {
+ capturedSetting = &parent->capturedSetting->add(name, type);
+ }
+ else
+ {
+ capturedSetting = &(*parent->capturedSetting)[name.c_str()];
+ }
+ }
+ else
+ {
+ if (index < parent->capturedSetting->getLength())
+ {
+ capturedSetting = &(*parent->capturedSetting)[0];
+ }
+ else
+ {
+ assert(index == parent->capturedSetting->getLength()); // you requested an index while omitting at least one of its previous siblings
+ capturedSetting = &parent->capturedSetting->add(type);
+ }
+ }
+
+ ConditionalSetCapturedDefaultValue<T>();
+ }
+ }
+
+
+ std::string GetPath() const
+ {
+ if (setting)
+ {
+ return setting->getPath();
+ }
+
+ std::string path = (name.length() > 0) ? name : "[" + std::to_string(index) + "]";
+ if (parent)
+ {
+ auto parentPath = parent->GetPath();
+ return (parentPath.length() > 0) ? (parentPath + ((name.length() == 0) ? "" : ".") + path) : path;
+ }
+ return path;
+ }
+
+ void PropagateAnySettingIsMissing()
+ {
+ anySettingIsMissing = true;
+ if (parent)
+ {
+ parent->PropagateAnySettingIsMissing();
+ }
+ }
+
+ void PropagateAnyMandatorySettingIsMissing()
+ {
+ anyMandatorySettingIsMissing = true;
+ if (parent)
+ {
+ parent->PropagateAnyMandatorySettingIsMissing();
+ }
+ }
+
+ template<typename T>
+ void AlertMandatorySettingMissing()
+ {
+ PropagateAnyMandatorySettingIsMissing();
+
+ err << "Missing '" << GetPath() << "' setting in configuration file." << std::endl;
+ }
+
+ template<typename T>
+ T GetUnsetDefaultValue() const
+ {
+ return (T)0;
+ }
+
+
+
+ template<typename T>
+ T GetDefaultValue() const
+ {
+ if (defaultVal.IsSet())
+ {
+ return (T)defaultVal;
+ }
+
+ return GetUnsetDefaultValue<T>();
+ }
+
+ template<typename T>
+ Setting::Type GetRequestedType() const
+ {
+ // TODO @ Hemofektik: Check whether the outcommented line is still needed. static_assert(false) is checked on compile time and, well, asserts :)
+ // static_assert(false, "should never happen, unless you requested an unsupported type");
+ return Setting::TypeNone;
+ }
+
+
+ void CheckType(const Variant& variant, Setting::Type expectedType) const
+ {
+ if (!variant.IsSet()) return;
+ if(expectedType != variant.GetType())
+ {
+ assert(false); // fix your code to match the whole chain of this setting to one single type!
+ err << "'" << GetPath() << "' setting limits or default value is of incompatible type." << std::endl;
+ }
+ }
+
+ std::string name;
+ int index;
+ ChainedSetting* parent;
+ Setting* setting;
+ std::ostream& err;
+ Variant defaultVal;
+ Variant minVal;
+ Variant maxVal;
+ bool isSettingMandatory;
+ bool anySettingIsMissing;
+ bool anyMandatorySettingIsMissing;
+ Config* capturedSpecification;
+ Setting* capturedSetting;
+ };
+
+ template<>
+ inline
+ void ChainedSetting::ConditionalSetCapturedDefaultValue<Setting>() { }
+
+ template<>
+ inline
+ std::string ChainedSetting::GetUnsetDefaultValue() const
+ {
+ return "";
+ }
+
+
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<int8_t>() const { return Setting::TypeInt; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<uint8_t>() const { return Setting::TypeInt; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<int16_t>() const { return Setting::TypeInt; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<uint16_t>() const { return Setting::TypeInt; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<int32_t>() const { return Setting::TypeInt; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<uint32_t>() const { return Setting::TypeInt; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<int64_t>() const { return Setting::TypeInt64; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<uint64_t>() const { return Setting::TypeInt64; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<float>() const { return Setting::TypeFloat; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<double>() const { return Setting::TypeFloat; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<std::string>() const { return Setting::TypeString; }
+ template<> inline Setting::Type ChainedSetting::GetRequestedType<bool>() const { return Setting::TypeBoolean; }
+}
+
+#endif \ No newline at end of file
diff --git a/contrib/cmake/1_configure.sh b/contrib/cmake/1_configure.sh
new file mode 100755
index 0000000..fe678f8
--- /dev/null
+++ b/contrib/cmake/1_configure.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+mkdir release
+cd release
+cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ..
diff --git a/contrib/cmake/2_make.sh b/contrib/cmake/2_make.sh
new file mode 100755
index 0000000..1717d77
--- /dev/null
+++ b/contrib/cmake/2_make.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cd release
+make \ No newline at end of file
diff --git a/contrib/cmake/CMakeFiles/CMakeCCompiler.cmake b/contrib/cmake/CMakeFiles/CMakeCCompiler.cmake
new file mode 100644
index 0000000..26afd10
--- /dev/null
+++ b/contrib/cmake/CMakeFiles/CMakeCCompiler.cmake
@@ -0,0 +1,36 @@
+SET(CMAKE_C_COMPILER "/usr/bin/gcc")
+SET(CMAKE_C_COMPILER_ARG1 "")
+SET(CMAKE_C_COMPILER_ID "GNU")
+SET(CMAKE_C_PLATFORM_ID "Linux")
+SET(CMAKE_AR "/usr/bin/ar")
+SET(CMAKE_RANLIB "/usr/bin/ranlib")
+SET(CMAKE_COMPILER_IS_GNUCC 1)
+SET(CMAKE_C_COMPILER_LOADED 1)
+SET(CMAKE_COMPILER_IS_MINGW )
+SET(CMAKE_COMPILER_IS_CYGWIN )
+IF(CMAKE_COMPILER_IS_CYGWIN)
+ SET(CYGWIN 1)
+ SET(UNIX 1)
+ENDIF(CMAKE_COMPILER_IS_CYGWIN)
+
+SET(CMAKE_C_COMPILER_ENV_VAR "CC")
+
+IF(CMAKE_COMPILER_IS_MINGW)
+ SET(MINGW 1)
+ENDIF(CMAKE_COMPILER_IS_MINGW)
+SET(CMAKE_C_COMPILER_ID_RUN 1)
+SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
+SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+SET(CMAKE_C_LINKER_PREFERENCE 10)
+
+# Save compiler ABI information.
+SET(CMAKE_C_SIZEOF_DATA_PTR "4")
+SET(CMAKE_C_COMPILER_ABI "ELF")
+
+IF(CMAKE_C_SIZEOF_DATA_PTR)
+ SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
+ENDIF(CMAKE_C_SIZEOF_DATA_PTR)
+
+IF(CMAKE_C_COMPILER_ABI)
+ SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
+ENDIF(CMAKE_C_COMPILER_ABI)
diff --git a/contrib/cmake/CMakeFiles/CMakeCXXCompiler.cmake b/contrib/cmake/CMakeFiles/CMakeCXXCompiler.cmake
new file mode 100644
index 0000000..62c36c9
--- /dev/null
+++ b/contrib/cmake/CMakeFiles/CMakeCXXCompiler.cmake
@@ -0,0 +1,36 @@
+SET(CMAKE_CXX_COMPILER "/usr/bin/c++")
+SET(CMAKE_CXX_COMPILER_ARG1 "")
+SET(CMAKE_CXX_COMPILER_ID "GNU")
+SET(CMAKE_CXX_PLATFORM_ID "Linux")
+SET(CMAKE_AR "/usr/bin/ar")
+SET(CMAKE_RANLIB "/usr/bin/ranlib")
+SET(CMAKE_COMPILER_IS_GNUCXX 1)
+SET(CMAKE_CXX_COMPILER_LOADED 1)
+SET(CMAKE_COMPILER_IS_MINGW )
+SET(CMAKE_COMPILER_IS_CYGWIN )
+IF(CMAKE_COMPILER_IS_CYGWIN)
+ SET(CYGWIN 1)
+ SET(UNIX 1)
+ENDIF(CMAKE_COMPILER_IS_CYGWIN)
+
+SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
+
+IF(CMAKE_COMPILER_IS_MINGW)
+ SET(MINGW 1)
+ENDIF(CMAKE_COMPILER_IS_MINGW)
+SET(CMAKE_CXX_COMPILER_ID_RUN 1)
+SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;H;o;O;obj;OBJ;def;DEF;rc;RC)
+SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm)
+SET(CMAKE_CXX_LINKER_PREFERENCE 30)
+
+# Save compiler ABI information.
+SET(CMAKE_CXX_SIZEOF_DATA_PTR "4")
+SET(CMAKE_CXX_COMPILER_ABI "ELF")
+
+IF(CMAKE_CXX_SIZEOF_DATA_PTR)
+ SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
+ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR)
+
+IF(CMAKE_CXX_COMPILER_ABI)
+ SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
+ENDIF(CMAKE_CXX_COMPILER_ABI)
diff --git a/contrib/cmake/CMakeFiles/CMakeSystem.cmake b/contrib/cmake/CMakeFiles/CMakeSystem.cmake
new file mode 100644
index 0000000..24477a5
--- /dev/null
+++ b/contrib/cmake/CMakeFiles/CMakeSystem.cmake
@@ -0,0 +1,15 @@
+
+
+SET(CMAKE_SYSTEM "Linux-2.6.31-20-generic-pae")
+SET(CMAKE_SYSTEM_NAME "Linux")
+SET(CMAKE_SYSTEM_VERSION "2.6.31-20-generic-pae")
+SET(CMAKE_SYSTEM_PROCESSOR "i686")
+
+SET(CMAKE_HOST_SYSTEM "Linux-2.6.31-20-generic-pae")
+SET(CMAKE_HOST_SYSTEM_NAME "Linux")
+SET(CMAKE_HOST_SYSTEM_VERSION "2.6.31-20-generic-pae")
+SET(CMAKE_HOST_SYSTEM_PROCESSOR "i686")
+
+SET(CMAKE_CROSSCOMPILING "FALSE")
+
+SET(CMAKE_SYSTEM_LOADED 1)
diff --git a/contrib/cmake/CMakeFiles/CompilerIdC/CMakeCCompilerId.c b/contrib/cmake/CMakeFiles/CompilerIdC/CMakeCCompilerId.c
new file mode 100644
index 0000000..7fd0088
--- /dev/null
+++ b/contrib/cmake/CMakeFiles/CompilerIdC/CMakeCCompilerId.c
@@ -0,0 +1,182 @@
+#ifdef __cplusplus
+# error "A C++ compiler has been selected for C."
+#endif
+
+#if defined(__18CXX)
+# define ID_VOID_MAIN
+#endif
+
+#if defined(__INTEL_COMPILER) || defined(__ICC)
+# define COMPILER_ID "Intel"
+
+#elif defined(__BORLANDC__)
+# define COMPILER_ID "Borland"
+
+#elif defined(__WATCOMC__)
+# define COMPILER_ID "Watcom"
+
+#elif defined(__SUNPRO_C)
+# define COMPILER_ID "SunPro"
+
+#elif defined(__HP_cc)
+# define COMPILER_ID "HP"
+
+#elif defined(__DECC)
+# define COMPILER_ID "Compaq"
+
+#elif defined(__IBMC__)
+# define COMPILER_ID "VisualAge"
+
+#elif defined(__PGI)
+# define COMPILER_ID "PGI"
+
+#elif defined(__GNUC__)
+# define COMPILER_ID "GNU"
+
+#elif defined(_MSC_VER)
+# define COMPILER_ID "MSVC"
+
+#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
+/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
+ SHARC (21000) DSPs */
+# define COMPILER_ID "ADSP"
+
+/* IAR Systems compiler for embedded systems.
+ http://www.iar.com
+ Not supported yet by CMake
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define COMPILER_ID "IAR" */
+
+/* sdcc, the small devices C compiler for embedded systems,
+ http://sdcc.sourceforge.net */
+#elif defined(SDCC)
+# define COMPILER_ID "SDCC"
+
+#elif defined(_COMPILER_VERSION)
+# define COMPILER_ID "MIPSpro"
+
+/* This compiler is either not known or is too old to define an
+ identification macro. Try to identify the platform and guess that
+ it is the native compiler. */
+#elif defined(__sgi)
+# define COMPILER_ID "MIPSpro"
+
+#elif defined(__hpux) || defined(__hpua)
+# define COMPILER_ID "HP"
+
+#else /* unknown compiler */
+# define COMPILER_ID ""
+
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+
+/* Identify known platforms by name. */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+# define PLATFORM_ID "Linux"
+
+#elif defined(__CYGWIN__)
+# define PLATFORM_ID "Cygwin"
+
+#elif defined(__MINGW32__)
+# define PLATFORM_ID "MinGW"
+
+#elif defined(__APPLE__)
+# define PLATFORM_ID "Darwin"
+
+#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+# define PLATFORM_ID "Windows"
+
+#elif defined(__FreeBSD__) || defined(__FreeBSD)
+# define PLATFORM_ID "FreeBSD"
+
+#elif defined(__NetBSD__) || defined(__NetBSD)
+# define PLATFORM_ID "NetBSD"
+
+#elif defined(__OpenBSD__) || defined(__OPENBSD)
+# define PLATFORM_ID "OpenBSD"
+
+#elif defined(__sun) || defined(sun)
+# define PLATFORM_ID "SunOS"
+
+#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
+# define PLATFORM_ID "AIX"
+
+#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
+# define PLATFORM_ID "IRIX"
+
+#elif defined(__hpux) || defined(__hpux__)
+# define PLATFORM_ID "HP-UX"
+
+#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
+# define PLATFORM_ID "Haiku"
+/* Haiku also defines __BEOS__ so we must
+ put it prior to the check for __BEOS__
+*/
+
+#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
+# define PLATFORM_ID "BeOS"
+
+#elif defined(__QNX__) || defined(__QNXNTO__)
+# define PLATFORM_ID "QNX"
+
+#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
+# define PLATFORM_ID "Tru64"
+
+#elif defined(__riscos) || defined(__riscos__)
+# define PLATFORM_ID "RISCos"
+
+#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
+# define PLATFORM_ID "SINIX"
+
+#elif defined(__UNIX_SV__)
+# define PLATFORM_ID "UNIX_SV"
+
+#elif defined(__bsdos__)
+# define PLATFORM_ID "BSDOS"
+
+#elif defined(_MPRAS) || defined(MPRAS)
+# define PLATFORM_ID "MP-RAS"
+
+#elif defined(__osf) || defined(__osf__)
+# define PLATFORM_ID "OSF1"
+
+#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
+# define PLATFORM_ID "SCO_SV"
+
+#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
+# define PLATFORM_ID "ULTRIX"
+
+#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
+# define PLATFORM_ID "Xenix"
+
+#else /* unknown platform */
+# define PLATFORM_ID ""
+
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
+
+
+/*--------------------------------------------------------------------------*/
+
+#ifdef ID_VOID_MAIN
+void main() {}
+#else
+int main(int argc, char* argv[])
+{
+ int require = 0;
+ require += info_compiler[argc];
+ require += info_platform[argc];
+ (void)argv;
+ return require;
+}
+#endif
diff --git a/contrib/cmake/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp b/contrib/cmake/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp
new file mode 100644
index 0000000..f8c041f
--- /dev/null
+++ b/contrib/cmake/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp
@@ -0,0 +1,169 @@
+/* This source file must have a .cpp extension so that all C++ compilers
+ recognize the extension without flags. Borland does not know .cxx for
+ example. */
+#ifndef __cplusplus
+# error "A C compiler has been selected for C++."
+#endif
+
+#if defined(__COMO__)
+# define COMPILER_ID "Comeau"
+
+#elif defined(__INTEL_COMPILER) || defined(__ICC)
+# define COMPILER_ID "Intel"
+
+#elif defined(__BORLANDC__)
+# define COMPILER_ID "Borland"
+
+#elif defined(__WATCOMC__)
+# define COMPILER_ID "Watcom"
+
+#elif defined(__SUNPRO_CC)
+# define COMPILER_ID "SunPro"
+
+#elif defined(__HP_aCC)
+# define COMPILER_ID "HP"
+
+#elif defined(__DECCXX)
+# define COMPILER_ID "Compaq"
+
+#elif defined(__IBMCPP__)
+# define COMPILER_ID "VisualAge"
+
+#elif defined(__PGI)
+# define COMPILER_ID "PGI"
+
+#elif defined(__GNUC__)
+# define COMPILER_ID "GNU"
+
+#elif defined(_MSC_VER)
+# define COMPILER_ID "MSVC"
+
+#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
+/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
+ SHARC (21000) DSPs */
+# define COMPILER_ID "ADSP"
+
+#elif defined(_COMPILER_VERSION)
+# define COMPILER_ID "MIPSpro"
+
+/* This compiler is either not known or is too old to define an
+ identification macro. Try to identify the platform and guess that
+ it is the native compiler. */
+#elif defined(__sgi)
+# define COMPILER_ID "MIPSpro"
+
+#elif defined(__hpux) || defined(__hpua)
+# define COMPILER_ID "HP"
+
+#else /* unknown compiler */
+# define COMPILER_ID ""
+
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+
+/* Identify known platforms by name. */
+#if defined(__linux) || defined(__linux__) || defined(linux)
+# define PLATFORM_ID "Linux"
+
+#elif defined(__CYGWIN__)
+# define PLATFORM_ID "Cygwin"
+
+#elif defined(__MINGW32__)
+# define PLATFORM_ID "MinGW"
+
+#elif defined(__APPLE__)
+# define PLATFORM_ID "Darwin"
+
+#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+# define PLATFORM_ID "Windows"
+
+#elif defined(__FreeBSD__) || defined(__FreeBSD)
+# define PLATFORM_ID "FreeBSD"
+
+#elif defined(__NetBSD__) || defined(__NetBSD)
+# define PLATFORM_ID "NetBSD"
+
+#elif defined(__OpenBSD__) || defined(__OPENBSD)
+# define PLATFORM_ID "OpenBSD"
+
+#elif defined(__sun) || defined(sun)
+# define PLATFORM_ID "SunOS"
+
+#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
+# define PLATFORM_ID "AIX"
+
+#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
+# define PLATFORM_ID "IRIX"
+
+#elif defined(__hpux) || defined(__hpux__)
+# define PLATFORM_ID "HP-UX"
+
+#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
+# define PLATFORM_ID "Haiku"
+/* Haiku also defines __BEOS__ so we must
+ put it prior to the check for __BEOS__
+*/
+
+#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
+# define PLATFORM_ID "BeOS"
+
+#elif defined(__QNX__) || defined(__QNXNTO__)
+# define PLATFORM_ID "QNX"
+
+#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
+# define PLATFORM_ID "Tru64"
+
+#elif defined(__riscos) || defined(__riscos__)
+# define PLATFORM_ID "RISCos"
+
+#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
+# define PLATFORM_ID "SINIX"
+
+#elif defined(__UNIX_SV__)
+# define PLATFORM_ID "UNIX_SV"
+
+#elif defined(__bsdos__)
+# define PLATFORM_ID "BSDOS"
+
+#elif defined(_MPRAS) || defined(MPRAS)
+# define PLATFORM_ID "MP-RAS"
+
+#elif defined(__osf) || defined(__osf__)
+# define PLATFORM_ID "OSF1"
+
+#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
+# define PLATFORM_ID "SCO_SV"
+
+#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
+# define PLATFORM_ID "ULTRIX"
+
+#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
+# define PLATFORM_ID "Xenix"
+
+#else /* unknown platform */
+# define PLATFORM_ID ""
+
+#endif
+
+/* Construct the string literal in pieces to prevent the source from
+ getting matched. Store it in a pointer rather than an array
+ because some compilers will just produce instructions to fill the
+ array rather than assigning a pointer to a static array. */
+char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
+
+
+/*--------------------------------------------------------------------------*/
+
+int main(int argc, char* argv[])
+{
+ int require = 0;
+ require += info_compiler[argc];
+ require += info_platform[argc];
+ (void)argv;
+ return require;
+}
diff --git a/contrib/cmake/CMakeLists.txt b/contrib/cmake/CMakeLists.txt
new file mode 100644
index 0000000..716888f
--- /dev/null
+++ b/contrib/cmake/CMakeLists.txt
@@ -0,0 +1,22 @@
+#cmake_minimum_required(VERSION 2.8)
+
+PROJECT(libconfig_test_app)
+
+add_subdirectory(src)
+
+#add cmake script files
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_work")
+
+#check if libconfig is present (FindConfig.cmake and FindConfig++.cmake files)
+FIND_PACKAGE(Config REQUIRED)
+FIND_PACKAGE(Config++ REQUIRED)
+
+#add undelete support
+CONFIGURE_FILE(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_work/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_work/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY)
+ADD_CUSTOM_TARGET(uninstall
+ "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_work/cmake_uninstall.cmake")
+
+
diff --git a/contrib/cmake/cmake_work/FindConfig++.cmake b/contrib/cmake/cmake_work/FindConfig++.cmake
new file mode 100644
index 0000000..f6d11a3
--- /dev/null
+++ b/contrib/cmake/cmake_work/FindConfig++.cmake
@@ -0,0 +1,23 @@
+FIND_PATH(CONFIG++_INCLUDE_DIR libconfig.h++ /usr/include /usr/local/include)
+
+FIND_LIBRARY(CONFIG++_LIBRARY NAMES config++ PATH /usr/lib /usr/local/lib)
+
+IF (CONFIG++_INCLUDE_DIR AND CONFIG++_LIBRARY)
+ SET(CONFIG++_FOUND TRUE)
+ENDIF ( CONFIG++_INCLUDE_DIR AND CONFIG++_LIBRARY)
+
+IF (CONFIG++_FOUND)
+ IF (NOT CONFIG++_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Config++: ${CONFIG++_LIBRARY}")
+ ENDIF (NOT CONFIG++_FIND_QUIETLY)
+ELSE(CONFIG++_FOUND)
+ IF (Config++_FIND_REQUIRED)
+ IF(NOT CONFIG++_INCLUDE_DIR)
+ MESSAGE(FATAL_ERROR "Could not find LibConfig++ header file!")
+ ENDIF(NOT CONFIG++_INCLUDE_DIR)
+
+ IF(NOT CONFIG++_LIBRARY)
+ MESSAGE(FATAL_ERROR "Could not find LibConfig++ library file!")
+ ENDIF(NOT CONFIG++_LIBRARY)
+ ENDIF (Config++_FIND_REQUIRED)
+ENDIF (CONFIG++_FOUND) \ No newline at end of file
diff --git a/contrib/cmake/cmake_work/FindConfig.cmake b/contrib/cmake/cmake_work/FindConfig.cmake
new file mode 100644
index 0000000..5361d96
--- /dev/null
+++ b/contrib/cmake/cmake_work/FindConfig.cmake
@@ -0,0 +1,23 @@
+FIND_PATH(CONFIG_INCLUDE_DIR libconfig.h /usr/include /usr/local/include)
+
+FIND_LIBRARY(CONFIG_LIBRARY NAMES config PATH /usr/lib /usr/local/lib)
+
+IF (CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY)
+ SET(CONFIG_FOUND TRUE)
+ENDIF ( CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY)
+
+IF (CONFIG_FOUND)
+ IF (NOT CONFIG_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Config: ${CONFIG_LIBRARY}")
+ ENDIF (NOT CONFIG_FIND_QUIETLY)
+ELSE(CONFIG_FOUND)
+ IF (Config_FIND_REQUIRED)
+ IF(NOT CONFIG_INCLUDE_DIR)
+ MESSAGE(FATAL_ERROR "Could not find LibConfig header file!")
+ ENDIF(NOT CONFIG_INCLUDE_DIR)
+
+ IF(NOT CONFIG_LIBRARY)
+ MESSAGE(FATAL_ERROR "Could not find LibConfig library file!")
+ ENDIF(NOT CONFIG_LIBRARY)
+ ENDIF (Config_FIND_REQUIRED)
+ENDIF (CONFIG_FOUND) \ No newline at end of file
diff --git a/contrib/cmake/cmake_work/cmake_uninstall.cmake.in b/contrib/cmake/cmake_work/cmake_uninstall.cmake.in
new file mode 100644
index 0000000..10a2937
--- /dev/null
+++ b/contrib/cmake/cmake_work/cmake_uninstall.cmake.in
@@ -0,0 +1,36 @@
+# Copyright 2006-2008 The FLWOR Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+STRING(REGEX REPLACE "\n" ";" files "${files}")
+FOREACH(file ${files})
+ MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ IF(EXISTS "$ENV{DESTDIR}${file}")
+ EXEC_PROGRAM(
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ IF("${rm_retval}" STREQUAL 0)
+ ELSE("${rm_retval}" STREQUAL 0)
+ MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ ENDIF("${rm_retval}" STREQUAL 0)
+ ELSE(EXISTS "$ENV{DESTDIR}${file}")
+ MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ ENDIF(EXISTS "$ENV{DESTDIR}${file}")
+ENDFOREACH(file)
diff --git a/contrib/cmake/src/CMakeLists.txt b/contrib/cmake/src/CMakeLists.txt
new file mode 100644
index 0000000..b10b7da
--- /dev/null
+++ b/contrib/cmake/src/CMakeLists.txt
@@ -0,0 +1,6 @@
+PROJECT(libconfig_test_app)
+
+ADD_EXECUTABLE(libconfig_test_app main.cpp)
+
+target_link_libraries(libconfig_test_app config++)
+
diff --git a/contrib/cmake/src/main.cpp b/contrib/cmake/src/main.cpp
new file mode 100644
index 0000000..a563249
--- /dev/null
+++ b/contrib/cmake/src/main.cpp
@@ -0,0 +1,13 @@
+#include <iostream>
+#include <fstream>
+#include <libconfig.h++>
+
+using namespace std;
+using namespace libconfig;
+
+int main ( int argc, char **argv )
+{
+ Config cfg;
+
+ return (0);
+} \ No newline at end of file
diff --git a/contrib/copy_setting.c b/contrib/copy_setting.c
new file mode 100644
index 0000000..1b20e59
--- /dev/null
+++ b/contrib/copy_setting.c
@@ -0,0 +1,161 @@
+void config_setting_copy_simple(config_setting_t * parent, const config_setting_t * src);
+void config_setting_copy_elem(config_setting_t * parent, const config_setting_t * src);
+
+void config_setting_copy_aggregate(config_setting_t * parent, const config_setting_t * src);
+int config_setting_copy(config_setting_t * parent, const config_setting_t * src);
+
+void config_setting_copy_simple(config_setting_t * parent, const config_setting_t * src)
+{
+ if(config_setting_is_aggregate(src))
+ {
+ config_setting_copy_aggregate(parent, src);
+ }
+ else
+ {
+ config_setting_t * set;
+
+ set = config_setting_add(parent, config_setting_name(src), config_setting_type(src));
+
+ if(CONFIG_TYPE_INT == config_setting_type(src))
+ {
+ config_setting_set_int(set, config_setting_get_int(src));
+ config_setting_set_format(set, src->format);
+ }
+ else if(CONFIG_TYPE_INT64 == config_setting_type(src))
+ {
+ config_setting_set_int64(set, config_setting_get_int64(src));
+ config_setting_set_format(set, src->format);
+ }
+ else if(CONFIG_TYPE_FLOAT == config_setting_type(src))
+ config_setting_set_float(set, config_setting_get_float(src));
+ else if(CONFIG_TYPE_STRING == config_setting_type(src))
+ config_setting_set_string(set, config_setting_get_string(src));
+ else if(CONFIG_TYPE_BOOL == config_setting_type(src))
+ config_setting_set_bool(set, config_setting_get_bool(src));
+ }
+}
+
+void config_setting_copy_elem(config_setting_t * parent, const config_setting_t * src)
+{
+ config_setting_t * set;
+
+ set = NULL;
+ if(config_setting_is_aggregate(src))
+ config_setting_copy_aggregate(parent, src);
+ else if(CONFIG_TYPE_INT == config_setting_type(src))
+ {
+ set = config_setting_set_int_elem(parent, -1, config_setting_get_int(src));
+ config_setting_set_format(set, src->format);
+ }
+ else if(CONFIG_TYPE_INT64 == config_setting_type(src))
+ {
+ set = config_setting_set_int64_elem(parent, -1, config_setting_get_int64(src));
+ config_setting_set_format(set, src->format);
+ }
+ else if(CONFIG_TYPE_FLOAT == config_setting_type(src))
+ set = config_setting_set_float_elem(parent, -1, config_setting_get_float(src));
+ else if(CONFIG_TYPE_STRING == config_setting_type(src))
+ set = config_setting_set_string_elem(parent, -1, config_setting_get_string(src));
+ else if(CONFIG_TYPE_BOOL == config_setting_type(src))
+ set = config_setting_set_bool_elem(parent, -1, config_setting_get_bool(src));
+}
+
+void config_setting_copy_aggregate(config_setting_t * parent, const config_setting_t * src)
+{
+ config_setting_t * newAgg;
+ int i, n;
+
+ newAgg = config_setting_add(parent, config_setting_name(src), config_setting_type(src));
+
+ n = config_setting_length(src);
+ for(i = 0; i < n; i++)
+ {
+ if(config_setting_is_group(src))
+ {
+ config_setting_copy_simple(newAgg, config_setting_get_elem(src, i));
+ }
+ else
+ {
+ config_setting_copy_elem(newAgg, config_setting_get_elem(src, i));
+ }
+ }
+}
+
+int config_setting_copy(config_setting_t * parent, const config_setting_t * src)
+{
+ if((!config_setting_is_group(parent)) &&
+ (!config_setting_is_list(parent)))
+ return CONFIG_FALSE;
+
+ if(config_setting_is_aggregate(src))
+ {
+ config_setting_copy_aggregate(parent, src);
+ }
+ else
+ {
+ config_setting_copy_simple(parent, src);
+ }
+
+ return CONFIG_TRUE;
+}
+
+
+//Some sample code
+
+//-----------------------------------------------------------------------------
+int main(int argc, char *argv[])
+//-----------------------------------------------------------------------------
+{
+ config_t cfgSrc;
+ config_t cfgSrcCopy;
+ config_t cfgDst;
+
+
+ config_init(&cfgSrc);
+ config_init(&cfgSrcCopy);
+ config_init(&cfgDst);
+
+ if(CONFIG_FALSE == config_read_file(&cfgSrc, "/data/menu/cfgSrc.cfg"))
+ {
+ fprintf(stderr, "Failed to open cfgSrc.cfg\n");
+ }
+ if(CONFIG_FALSE == config_read_file(&cfgDst, "/data/menu/cfgDst.cfg"))
+ {
+ fprintf(stderr, "Failed to open cfgDst.cfg\n");
+ }
+
+ /*
+ printf("Dump cfgSrc.cfg\n");
+ DumpCfgSetting(config_root_setting(&cfgSrc));
+
+ printf("Dump cfgDst.cfg\n");
+ DumpCfgSetting(config_root_setting(&cfgDst));
+ */
+
+ config_setting_t * src;
+ config_setting_t * dst;
+
+ dst = config_lookup(&cfgDst, "grp1");
+
+ if((0 != (dst = config_lookup(&cfgDst, "grp1"))) &&
+ (0 != (src = config_lookup(&cfgSrc, "application.window"))))
+ //(0 != (src = config_lookup(&cfgSrc, "list"))))
+
+ {
+ if(CONFIG_FALSE == config_setting_copy(dst, src))
+ {
+ printf("Failed to copy src to dst\n");
+ }
+ }
+
+ config_setting_copy(config_root_setting(&cfgSrcCopy), config_root_setting(&cfgSrc));
+
+ config_write_file(&cfgDst, "/data/menu/cfgDstMod.cfg");
+ config_write_file(&cfgSrcCopy, "/data/menu/cfgSrcCpy.cfg");
+ config_write_file(&cfgSrc, "/data/menu/cfgSrcOrig.cfg");
+
+ config_destroy(&cfgSrc);
+ config_destroy(&cfgDst);
+
+ return 0;
+}
diff --git a/contrib/libconfig-ruby/README b/contrib/libconfig-ruby/README
new file mode 100644
index 0000000..1a45477
--- /dev/null
+++ b/contrib/libconfig-ruby/README
@@ -0,0 +1,76 @@
+# << Usage >>
+
+# you can feed this README to irb and see the result
+# $ irb README
+
+# IMPORTANT NOTICE:
+# be careful with big *fixnum* (plain int) values in configs
+# int is 32 bit, but ruby fixnum is only 31!
+# For example, 2100000000 will be read as -47483648.
+
+require 'rconfig'
+c = Config.new
+
+c.read!('test.cfg')
+# => IOError
+c.read('test.cfg')
+# => false
+
+p c['some_var']
+# => SettingNotFoundError
+# note: Config#lookup is alias for Config#[]
+
+c.append 'fixnum', Config::Fixnum.new(150)
+# #<Config::Fixnum...>
+
+f1 = Config::Fixnum.new(1)
+c.append 'another_fixnum', f1
+
+f2 = Config::Fixnum.new(256)
+c.append 'next_fixnum', f2
+
+p c.size
+# => 3
+
+c.delete(f1) # by element
+c.delete(0) # by index
+c.delete('next_fixnum') # by name
+# note: (at now) you cannot delete nested elements by Config#delete
+# you can do c['nested.element'].parent.delete(c['nested.element'])
+
+p c.size
+# => 0
+
+l = Config::List.new
+c.append 'the_list', l
+
+l.append Config::String.new("abcdef")
+l << Config::Float.new(3.14)
+# note: Config::List#append and Config::Array#append both have
+# aliases Config::[Aggregate]#<<
+
+p l.name
+# => "the_list"
+
+p l.index
+# => 0
+
+p l.root?
+# => false
+
+p l.size
+# => 3
+
+l[0].format = Config::FORMAT_HEX
+
+p l[1].value
+# => 3.14
+
+l[1].value = 2.71828
+
+c.write 'test.cfg'
+
+# you will get test.cfg with following contents:
+#
+# the_list = ( "abcdef", 2.71828, 0x2A );
+#
diff --git a/contrib/libconfig-ruby/Rakefile b/contrib/libconfig-ruby/Rakefile
new file mode 100644
index 0000000..f1b7845
--- /dev/null
+++ b/contrib/libconfig-ruby/Rakefile
@@ -0,0 +1,17 @@
+require 'rubygems'
+require 'rubygems/package_task'
+
+spec = Gem::Specification.new do |s|
+ s.name = "rconfig"
+ s.version = "1.0.1"
+ s.author = "Peter Zotov"
+ s.email = "whitequark@whitequark.ru"
+ s.platform = Gem::Platform::RUBY
+ s.summary = "libconfig bindings"
+ s.files = [ File.join('ext', 'extconf.rb'), File.join('ext', 'rconfig.c') ].to_a
+ s.extensions = 'ext/extconf.rb'
+end
+
+Gem::PackageTask.new(spec) do |pkg|
+end
+
diff --git a/contrib/libconfig-ruby/ext/extconf.rb b/contrib/libconfig-ruby/ext/extconf.rb
new file mode 100644
index 0000000..e6d65ca
--- /dev/null
+++ b/contrib/libconfig-ruby/ext/extconf.rb
@@ -0,0 +1,11 @@
+#!/usr/bin/ruby
+require "mkmf"
+
+unless pkg_config('libconfig')
+ puts 'failure: need libconfig'
+ exit 1
+end
+
+have_func('rb_block_call', 'ruby/ruby.h')
+
+create_makefile("rconfig")
diff --git a/contrib/libconfig-ruby/ext/rconfig.c b/contrib/libconfig-ruby/ext/rconfig.c
new file mode 100644
index 0000000..fa0bc96
--- /dev/null
+++ b/contrib/libconfig-ruby/ext/rconfig.c
@@ -0,0 +1,700 @@
+#include <ruby.h>
+#include <libconfig.h>
+
+static VALUE cConfig, cConfigBaseSetting, cConfigSetting, cConfigAggregate;
+static VALUE cConfigFormatDefault, cConfigFormatHex;
+static VALUE cConfigFixnum, cConfigBignum, cConfigFloat, cConfigBoolean, cConfigString;
+static VALUE cConfigGroup, cConfigList, cConfigArray;
+
+static VALUE rSettingNameRegexp;
+static VALUE aConfigSettings, aConfigScalars, aConfigAggregates;
+static VALUE eConfigParseError, eSettingNotFoundError, eSettingFormatError, eSettingNameError;
+
+static VALUE rconfig_wrap_value(config_setting_t* setting)
+{
+ switch(config_setting_type(setting)) {
+ case CONFIG_TYPE_INT:
+ return LONG2FIX(config_setting_get_int(setting));
+
+ case CONFIG_TYPE_INT64:
+ return rb_ll2inum(config_setting_get_int64(setting));
+
+ case CONFIG_TYPE_FLOAT:
+ return rb_float_new(config_setting_get_float(setting));
+
+ case CONFIG_TYPE_STRING:
+ return rb_str_new2(config_setting_get_string(setting));
+
+ case CONFIG_TYPE_BOOL:
+ return config_setting_get_bool(setting) ? Qtrue : Qfalse;
+
+ default:
+ rb_bug("unknown value type %d", config_setting_type(setting));
+ }
+}
+
+static void rconfig_free_setting(config_setting_t* setting)
+{
+ // dummy
+}
+
+static VALUE rconfig_prepare_setting(config_setting_t* setting)
+{
+ VALUE wrapper = Data_Wrap_Struct(rb_cObject, 0, rconfig_free_setting, setting);
+ config_setting_set_hook(setting, (void*) wrapper);
+ return wrapper;
+}
+
+static void rconfig_destroy_setting(void* hook)
+{
+ if(hook != NULL) {
+ VALUE wrapper = (VALUE) hook;
+ rb_iv_set(wrapper, "@setting", Qnil);
+ }
+}
+
+static VALUE rconfig_wrap_setting(config_setting_t* setting)
+{
+ VALUE rbSetting = rconfig_prepare_setting(setting);
+
+ switch(config_setting_type(setting)) {
+ case CONFIG_TYPE_INT:
+ return rb_funcall(cConfigFixnum, rb_intern("new"), 2, LONG2FIX(config_setting_get_int(setting)), rbSetting);
+
+ case CONFIG_TYPE_INT64:
+ return rb_funcall(cConfigBignum, rb_intern("new"), 2, rb_ll2inum(config_setting_get_int64(setting)), rbSetting);
+
+ case CONFIG_TYPE_FLOAT:
+ return rb_funcall(cConfigFloat, rb_intern("new"), 2, rb_float_new(config_setting_get_float(setting)), rbSetting);
+
+ case CONFIG_TYPE_STRING:
+ return rb_funcall(cConfigString, rb_intern("new"), 2, rb_str_new2(config_setting_get_string(setting)), rbSetting);
+
+ case CONFIG_TYPE_BOOL:
+ return rb_funcall(cConfigBoolean, rb_intern("new"), 2, config_setting_get_bool(setting) ? Qtrue : Qfalse, rbSetting);
+
+ case CONFIG_TYPE_ARRAY:
+ return rb_funcall(cConfigArray, rb_intern("new"), 2, Qnil, rbSetting);
+
+ case CONFIG_TYPE_LIST:
+ return rb_funcall(cConfigList, rb_intern("new"), 1, rbSetting);
+
+ case CONFIG_TYPE_GROUP:
+ return rb_funcall(cConfigGroup, rb_intern("new"), 1, rbSetting);
+
+ default:
+ rb_bug("[r] unknown setting type %d", config_setting_type(setting));
+ }
+}
+
+static void rconfig_update_setting(config_setting_t* setting, VALUE value)
+{
+ switch(config_setting_type(setting)) {
+ case CONFIG_TYPE_INT:
+ config_setting_set_int(setting, FIX2LONG(value));
+ break;
+
+ case CONFIG_TYPE_INT64:
+ if(TYPE(value) == T_BIGNUM)
+ config_setting_set_int64(setting, rb_big2ll(value));
+ else // T_FIXNUM
+ config_setting_set_int64(setting, FIX2INT(value));
+ break;
+
+ case CONFIG_TYPE_FLOAT:
+// ruby1.9 check
+#if HAVE_RB_BLOCK_CALL
+ config_setting_set_float(setting, RFLOAT_VALUE(value));
+#else
+ config_setting_set_float(setting, RFLOAT_VALUE(value));
+#endif
+ break;
+
+ case CONFIG_TYPE_STRING:
+ config_setting_set_string(setting, RSTRING_PTR(value));
+ break;
+
+ case CONFIG_TYPE_BOOL:
+ config_setting_set_bool(setting, value == Qtrue);
+ break;
+
+ default:
+ rb_bug("[w] unknown setting type %d", config_setting_type(setting));
+ }
+}
+
+static void rconfig_check_setting_type(VALUE object, VALUE value)
+{
+ if(rb_obj_class(object) == cConfigFixnum) {
+ Check_Type(value, T_FIXNUM);
+ } else if(rb_obj_class(object) == cConfigBignum) {
+ if(TYPE(value) != T_BIGNUM && TYPE(value) != T_FIXNUM)
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Fixnum or Bignum)", rb_obj_classname(value));
+ } else if(rb_obj_class(object) == cConfigFloat) {
+ Check_Type(value, T_FLOAT);
+ } else if(rb_obj_class(object) == cConfigString) {
+ Check_Type(value, T_STRING);
+ } else if(rb_obj_class(object) == cConfigBoolean) {
+ if(value != Qtrue && value != Qfalse)
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected boolean)", rb_obj_classname(value));
+ } else {
+ rb_raise(rb_eException, "never use Config::Setting itself");
+ }
+}
+
+static int rconfig_do_append(config_setting_t* setting, VALUE target, VALUE name)
+{
+ int type;
+ if(rb_obj_class(target) == cConfigFixnum)
+ type = CONFIG_TYPE_INT;
+ else if(rb_obj_class(target) == cConfigBignum)
+ type = CONFIG_TYPE_INT64;
+ else if(rb_obj_class(target) == cConfigFloat)
+ type = CONFIG_TYPE_FLOAT;
+ else if(rb_obj_class(target) == cConfigString)
+ type = CONFIG_TYPE_STRING;
+ else if(rb_obj_class(target) == cConfigBoolean)
+ type = CONFIG_TYPE_BOOL;
+ else if(rb_obj_class(target) == cConfigGroup)
+ type = CONFIG_TYPE_GROUP;
+ else if(rb_obj_class(target) == cConfigList)
+ type = CONFIG_TYPE_LIST;
+ else if(rb_obj_class(target) == cConfigArray)
+ type = CONFIG_TYPE_ARRAY;
+ else
+ rb_bug("unknown setting class %s", rb_obj_classname(target));
+
+ config_setting_t* new_setting;
+ if(name == Qnil) {
+ new_setting = config_setting_add(setting, NULL, type);
+ } else {
+ Check_Type(name, T_STRING);
+ new_setting = config_setting_add(setting, RSTRING_PTR(name), type);
+ }
+
+ if(new_setting == NULL)
+ return 0;
+
+ VALUE rbNewSetting = rconfig_prepare_setting(new_setting);
+ rb_iv_set(target, "@setting", rbNewSetting);
+
+ if(rb_ary_includes(aConfigScalars, rb_obj_class(target)) == Qtrue)
+ rconfig_update_setting(new_setting, rb_iv_get(target, "@value"));
+
+ if(rb_ary_includes(aConfigAggregates, rb_obj_class(target)) == Qtrue) {
+ if(rb_obj_class(target) == cConfigGroup) {
+ VALUE hash = rb_iv_get(target, "@hash");
+ VALUE children = rb_funcall(hash, rb_intern("keys"), 0);
+ int i;
+ for(i = 0; i < RARRAY_LEN(children); i++) {
+ VALUE key = RARRAY_PTR(children)[i];
+ rconfig_do_append(new_setting, rb_hash_aref(hash, key), key);
+ }
+ } else {
+ VALUE children = rb_iv_get(target, "@list");
+ int i;
+ for(i = 0; i < RARRAY_LEN(children); i++) {
+ rconfig_do_append(new_setting, RARRAY_PTR(children)[i], Qnil);
+ }
+ }
+ }
+
+ return 1;
+}
+
+static VALUE rbConfigBaseSetting_initialize(VALUE self, VALUE setting)
+{
+ if(setting != Qnil)
+ Check_Type(setting, T_DATA);
+ rb_iv_set(self, "@setting", setting);
+
+ return self;
+}
+
+static VALUE rbConfigBaseSetting_name(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting = NULL;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return rb_str_new2(config_setting_name(setting));
+ } else {
+ return Qnil;
+ }
+}
+
+static VALUE rbConfigBaseSetting_parent(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting = NULL;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return rconfig_wrap_setting(config_setting_parent(setting));
+ } else {
+ return Qnil;
+ }
+}
+
+static VALUE rbConfigBaseSetting_is_root(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting = NULL;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return config_setting_is_root(setting) ? Qtrue : Qfalse;
+ } else {
+ return Qnil;
+ }
+}
+
+static VALUE rbConfigBaseSetting_index(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting = NULL;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return INT2FIX(config_setting_index(setting));
+ } else {
+ return Qnil;
+ }
+}
+
+static VALUE rbConfigBaseSetting_line(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting = NULL;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return INT2FIX(config_setting_source_line(setting));
+ } else {
+ return Qnil;
+ }
+}
+
+static VALUE rbConfigSetting_initialize(int argc, VALUE* argv, VALUE self)
+{
+ VALUE value, setting;
+ rb_scan_args(argc, argv, "11", &value, &setting);
+
+ rb_call_super(1, &setting);
+
+ rconfig_check_setting_type(self, value);
+ rb_iv_set(self, "@value", value);
+
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* c_setting = NULL;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, c_setting);
+ rb_iv_set(self, "@format", INT2FIX(config_setting_get_format(c_setting)));
+ } else {
+ rb_iv_set(self, "@format", cConfigFormatDefault);
+ }
+
+ return self;
+}
+
+static VALUE rbConfigSetting_get_value(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return rconfig_wrap_value(setting);
+ } else {
+ return rb_iv_get(self, "@value");
+ }
+}
+
+static VALUE rbConfigSetting_set_value(VALUE self, VALUE new_value)
+{
+ rconfig_check_setting_type(self, new_value);
+
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ rconfig_update_setting(setting, new_value);
+ }
+
+ rb_iv_set(self, "@value", new_value);
+
+ return new_value;
+}
+
+static VALUE rbConfigSetting_get_format(VALUE self)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ return INT2FIX(config_setting_get_format(setting));
+ } else {
+ return rb_iv_get(self, "format");
+ }
+}
+
+static VALUE rbConfigSetting_set_format(VALUE self, VALUE new_format)
+{
+ if(rb_iv_get(self, "@setting") != Qnil) {
+ config_setting_t* setting;
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+ if(!config_setting_set_format(setting, FIX2INT(new_format)))
+ rb_raise(eSettingFormatError, "invalid setting format %d", FIX2INT(new_format));
+ }
+
+ rb_iv_set(self, "@format", new_format);
+
+ return new_format;
+}
+
+static VALUE rbConfigAggregate_get(VALUE self, VALUE index);
+
+static VALUE rbConfigAggregate_initialize(int argc, VALUE* argv, VALUE self)
+{
+ VALUE setting = Qnil;
+ if(rb_obj_class(self) == cConfigGroup || rb_obj_class(self) == cConfigList) {
+ rb_scan_args(argc, argv, "01", &setting);
+ } else if(rb_obj_class(self) == cConfigArray) {
+ VALUE type = Qnil;
+ rb_scan_args(argc, argv, "02", &type, &setting);
+
+ if(type != Qnil && rb_ary_includes(aConfigScalars, type) != Qtrue)
+ rb_raise(rb_eTypeError, "invalid setting array type %s", rb_class2name(type));
+
+ rb_iv_set(self, "@type", type);
+ } else {
+ rb_raise(rb_eException, "never create Config::Aggregate itself");
+ }
+
+ rb_call_super(1, &setting);
+
+ rb_iv_set(self, "@list", rb_ary_new());
+ if(rb_obj_class(self) == cConfigGroup)
+ rb_iv_set(self, "@hash", rb_hash_new());
+
+ if(setting != Qnil && rb_obj_class(self) == cConfigArray) {
+ config_setting_t* c_setting;
+ Data_Get_Struct(setting, config_setting_t, c_setting);
+ if(config_setting_length(c_setting) > 0)
+ rb_iv_set(self, "@type", rb_obj_class(rbConfigAggregate_get(self, INT2FIX(0))));
+ }
+
+ return self;
+}
+
+static VALUE rbConfigAggregate_size(VALUE self)
+{
+ config_setting_t* setting = NULL;
+ if(rb_iv_get(self, "@setting") != Qnil)
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+
+ if(setting)
+ return INT2FIX(config_setting_length(setting));
+ else
+ return INT2FIX(RARRAY_LEN(rb_iv_get(self, "@list")));
+}
+
+static VALUE rbConfigAggregate_get(VALUE self, VALUE index)
+{
+ config_setting_t* setting = NULL;
+ if(rb_iv_get(self, "@setting") != Qnil)
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+
+ VALUE rbTarget = Qnil;
+
+ if(TYPE(index) == T_STRING && rb_obj_class(self) == cConfigGroup) {
+ if(setting) {
+ config_setting_t* target = config_setting_get_member(setting, RSTRING_PTR(index));
+ if(target)
+ rbTarget = rconfig_wrap_setting(target);
+ } else {
+ rbTarget = rb_hash_aref(rb_iv_get(self, "@hash"), index);
+ }
+ } else if(TYPE(index) == T_FIXNUM) {
+ if(setting) {
+ config_setting_t* target = config_setting_get_elem(setting, FIX2INT(index));
+ if(target)
+ rbTarget = rconfig_wrap_setting(target);
+ } else {
+ rbTarget = rb_ary_entry(rb_iv_get(self, "@list"), FIX2INT(index));
+ }
+ } else {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected String or Fixnum)", rb_obj_classname(index));
+ }
+
+ if(rbTarget == Qnil)
+ if(TYPE(index) == T_STRING)
+ rb_raise(eSettingNotFoundError, "setting `%s' not found", RSTRING_PTR(index));
+ else
+ rb_raise(eSettingNotFoundError, "setting [%d] not found", FIX2INT(index));
+
+ return rbTarget;
+}
+
+static VALUE rbConfigAggregate_append(VALUE self, VALUE target)
+{
+ config_setting_t* setting = NULL;
+ if(rb_iv_get(self, "@setting") != Qnil)
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+
+ Check_Type(target, T_OBJECT);
+
+ VALUE type = rb_iv_get(self, "@type");
+ if(rb_obj_class(self) == cConfigArray) {
+ if(type != Qnil && type != rb_obj_class(target))
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)", rb_obj_classname(target), rb_class2name(type));
+ if(type == Qnil && rb_ary_includes(aConfigScalars, rb_obj_class(target)) != Qtrue)
+ rb_raise(rb_eTypeError, "invalid setting array type %s", rb_obj_classname(target));
+ }
+
+ if(rb_ary_includes(aConfigSettings, rb_obj_class(target)) == Qtrue) {
+ if(setting)
+ rconfig_do_append(setting, target, Qnil);
+ rb_ary_push(rb_iv_get(self, "@list"), target);
+ } else {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Config::BaseSetting)", rb_obj_classname(target));
+ }
+
+ if(rb_obj_class(self) == cConfigArray && type == Qnil)
+ rb_iv_set(self, "@type", rb_obj_class(target));
+
+ return target;
+}
+
+static VALUE rbConfigGroup_append(VALUE self, VALUE name, VALUE target)
+{
+ Check_Type(name, T_STRING);
+ Check_Type(target, T_OBJECT);
+
+ config_setting_t* setting = NULL;
+ if(rb_iv_get(self, "@setting") != Qnil)
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+
+ if(rb_ary_includes(aConfigSettings, rb_obj_class(target)) == Qtrue) {
+ if(rb_reg_match(rSettingNameRegexp, name) == Qnil)
+ rb_raise(eSettingNameError, "setting name `%s' contains invalid characters", RSTRING_PTR(name));
+ if(setting) {
+ if(!rconfig_do_append(setting, target, name))
+ rb_raise(eSettingNameError, "setting `%s' already exists", RSTRING_PTR(name));
+ } else if(rb_hash_aref(rb_iv_get(self, "@hash"), name) != Qnil) {
+ rb_raise(eSettingNameError, "setting `%s' already exists", RSTRING_PTR(name));
+ }
+ rb_ary_push(rb_iv_get(self, "@list"), target);
+ rb_hash_aset(rb_iv_get(self, "@hash"), name, target);
+ } else {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Config::BaseSetting)", rb_obj_classname(target));
+ }
+
+ return target;
+}
+
+static VALUE rbConfigAggregate_delete(VALUE self, VALUE target)
+{
+ config_setting_t* setting = NULL;
+ if(rb_iv_get(self, "@setting") != Qnil)
+ Data_Get_Struct(rb_iv_get(self, "@setting"), config_setting_t, setting);
+
+ VALUE hash = rb_iv_get(self, "@hash"), list = rb_iv_get(self, "@list");
+
+ if(TYPE(target) == T_STRING && rb_obj_class(self) == cConfigGroup) {
+ if(setting)
+ config_setting_remove(setting, RSTRING_PTR(target));
+
+ rb_ary_delete_at(list, rb_hash_aref(hash, target));
+ rb_hash_delete(hash, target);
+ } else if(TYPE(target) == T_FIXNUM) {
+ int index = FIX2INT(target);
+ if(setting)
+ config_setting_remove_elem(setting, index);
+
+ if(rb_obj_class(self) == cConfigGroup)
+ rb_hash_delete(hash, rbConfigBaseSetting_name(rb_ary_entry(list, index)));
+ rb_ary_delete_at(list, index);
+ } else if(rb_ary_includes(aConfigSettings, rb_obj_class(target)) == Qtrue) {
+ VALUE name = rbConfigBaseSetting_name(target);
+ if(setting)
+ config_setting_remove(setting, RSTRING_PTR(name));
+
+ if(rb_obj_class(self) == cConfigGroup)
+ rb_hash_delete(hash, name);
+ rb_ary_delete(list, target);
+ } else {
+ if(rb_obj_class(self) == cConfigGroup)
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected String, Fixnum or Config::BaseSetting)", rb_obj_classname(target));
+ else
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected Fixnum or Config::BaseSetting)", rb_obj_classname(target));
+ }
+
+ return Qnil;
+}
+
+static VALUE rbConfig_initialize(VALUE self)
+{
+ config_t* config = (config_t*) malloc(sizeof(config_t));
+ config_init(config);
+ config_set_destructor(config, &rconfig_destroy_setting);
+
+ VALUE rbConfig = Data_Wrap_Struct(rb_cObject, 0, config_destroy, config);
+ rb_iv_set(self, "@config", rbConfig);
+
+ return self;
+}
+
+static VALUE rbConfig_read_bang(VALUE self, VALUE path)
+{
+ Check_Type(path, T_STRING);
+
+ config_t* config;
+ Data_Get_Struct(rb_iv_get(self, "@config"), config_t, config);
+
+ if(!config_read_file(config, RSTRING_PTR(path))) {
+ if(config_error_line(config) == 0)
+ rb_raise(rb_eIOError, "cannot load config: I/O error");
+ else
+ rb_raise(eConfigParseError, "cannot parse config on line %d: `%s'",
+ config_error_line(config), config_error_text(config));
+ }
+
+ return Qtrue;
+}
+
+static VALUE rbConfig_write_bang(VALUE self, VALUE path)
+{
+ Check_Type(path, T_STRING);
+
+ config_t* config;
+ Data_Get_Struct(rb_iv_get(self, "@config"), config_t, config);
+
+ if(!config_write_file(config, RSTRING_PTR(path)))
+ rb_raise(rb_eIOError, "cannot save config: I/O error");
+
+ return Qtrue;
+}
+
+static VALUE rbConfig_read(VALUE self, VALUE path)
+{
+ Check_Type(path, T_STRING);
+
+ config_t* config;
+ Data_Get_Struct(rb_iv_get(self, "@config"), config_t, config);
+
+ return config_read_file(config, RSTRING_PTR(path)) ? Qtrue : Qfalse;
+}
+
+static VALUE rbConfig_write(VALUE self, VALUE path)
+{
+ Check_Type(path, T_STRING);
+
+ config_t* config;
+ Data_Get_Struct(rb_iv_get(self, "@config"), config_t, config);
+
+ return config_write_file(config, RSTRING_PTR(path)) ? Qtrue : Qfalse;
+}
+
+static VALUE rbConfig_root(VALUE self)
+{
+ config_t* config;
+ Data_Get_Struct(rb_iv_get(self, "@config"), config_t, config);
+
+ return rconfig_wrap_setting(config_root_setting(config));
+}
+
+static VALUE rbConfig_lookup(VALUE self, VALUE handle)
+{
+ if(TYPE(handle) == T_STRING) {
+ config_t* config;
+ Data_Get_Struct(rb_iv_get(self, "@config"), config_t, config);
+
+ config_setting_t* setting;
+ setting = config_lookup(config, RSTRING_PTR(handle));
+
+ if(setting == NULL)
+ rb_raise(eSettingNotFoundError, "setting `%s' not found", RSTRING_PTR(handle));
+
+ return rconfig_wrap_setting(setting);
+ } else if(TYPE(handle) == T_FIXNUM) {
+ return rbConfigAggregate_get(rbConfig_root(self), handle);
+ } else {
+ rb_raise(rb_eTypeError, "wrong argument type %s (expected String or Fixnum)", rb_obj_classname(handle));
+ }
+}
+
+static VALUE rbConfig_append(VALUE self, VALUE name, VALUE target)
+{
+ return rbConfigGroup_append(rbConfig_root(self), name, target);
+}
+
+static VALUE rbConfig_delete(VALUE self, VALUE name)
+{
+ return rbConfigAggregate_delete(rbConfig_root(self), name);
+}
+
+static VALUE rbConfig_size(VALUE self)
+{
+ return rbConfigAggregate_size(rbConfig_root(self));
+}
+
+void Init_rconfig()
+{
+ cConfig = rb_define_class("Config", rb_cObject);
+ rb_define_method(cConfig, "initialize", rbConfig_initialize, 0);
+ rb_define_method(cConfig, "read!", rbConfig_read_bang, 1);
+ rb_define_method(cConfig, "write!", rbConfig_write_bang, 1);
+ rb_define_method(cConfig, "read", rbConfig_read, 1);
+ rb_define_method(cConfig, "write", rbConfig_write, 1);
+ rb_define_method(cConfig, "root", rbConfig_root, 0);
+ rb_define_method(cConfig, "lookup", rbConfig_lookup, 1);
+ rb_define_method(cConfig, "[]", rbConfig_lookup, 1);
+ rb_define_method(cConfig, "append", rbConfig_append, 2);
+ rb_define_method(cConfig, "delete", rbConfig_delete, 1);
+ rb_define_method(cConfig, "size", rbConfig_size, 0);
+
+ cConfigBaseSetting = rb_define_class_under(cConfig, "BaseSetting", rb_cObject);
+ rb_define_method(cConfigBaseSetting, "initialize", rbConfigBaseSetting_initialize, 1);
+ rb_define_method(cConfigBaseSetting, "name", rbConfigBaseSetting_name, 0);
+ rb_define_method(cConfigBaseSetting, "parent", rbConfigBaseSetting_parent, 0);
+ rb_define_method(cConfigBaseSetting, "root?", rbConfigBaseSetting_is_root, 0);
+ rb_define_method(cConfigBaseSetting, "index", rbConfigBaseSetting_index, 0);
+ rb_define_method(cConfigBaseSetting, "line", rbConfigBaseSetting_line, 0);
+
+ cConfigSetting = rb_define_class_under(cConfig, "Setting", cConfigBaseSetting);
+ rb_define_method(cConfigSetting, "initialize", rbConfigSetting_initialize, -1);
+ rb_define_method(cConfigSetting, "value", rbConfigSetting_get_value, 0);
+ rb_define_method(cConfigSetting, "value=", rbConfigSetting_set_value, 1);
+ rb_define_method(cConfigSetting, "format", rbConfigSetting_get_format, 0);
+ rb_define_method(cConfigSetting, "format=", rbConfigSetting_set_format, 1);
+
+ cConfigFormatDefault = INT2FIX(CONFIG_FORMAT_DEFAULT);
+ rb_define_const(cConfig, "FORMAT_DEFAULT", cConfigFormatDefault);
+ cConfigFormatHex = INT2FIX(CONFIG_FORMAT_HEX);
+ rb_define_const(cConfig, "FORMAT_HEX", cConfigFormatHex);
+
+ cConfigFixnum = rb_define_class_under(cConfig, "Fixnum", cConfigSetting);
+ cConfigBignum = rb_define_class_under(cConfig, "Bignum", cConfigSetting);
+ cConfigFloat = rb_define_class_under(cConfig, "Float", cConfigSetting);
+ cConfigBoolean = rb_define_class_under(cConfig, "Boolean", cConfigSetting);
+ cConfigString = rb_define_class_under(cConfig, "String", cConfigSetting);
+
+ cConfigAggregate = rb_define_class_under(cConfig, "Aggregate", cConfigBaseSetting);
+ rb_define_method(cConfigAggregate, "initialize", rbConfigAggregate_initialize, -1);
+ rb_define_method(cConfigAggregate, "size", rbConfigAggregate_size, 0);
+ rb_define_method(cConfigAggregate, "get", rbConfigAggregate_get, 1);
+ rb_define_method(cConfigAggregate, "[]", rbConfigAggregate_get, 1);
+ rb_define_method(cConfigAggregate, "delete", rbConfigAggregate_delete, 1);
+
+ cConfigGroup = rb_define_class_under(cConfig, "Group", cConfigAggregate);
+ rb_define_method(cConfigGroup, "append", rbConfigGroup_append, 2);
+ cConfigArray = rb_define_class_under(cConfig, "Array", cConfigAggregate);
+ rb_define_method(cConfigArray, "append", rbConfigAggregate_append, 1);
+ rb_define_method(cConfigArray, "<<", rbConfigAggregate_append, 1);
+ cConfigList = rb_define_class_under(cConfig, "List", cConfigAggregate);
+ rb_define_method(cConfigList, "append", rbConfigAggregate_append, 1);
+ rb_define_method(cConfigList, "<<", rbConfigAggregate_append, 1);
+
+ aConfigScalars = rb_ary_new3(5, cConfigFixnum, cConfigBignum, cConfigFloat, cConfigBoolean, cConfigString);
+ aConfigAggregates = rb_ary_new3(3, cConfigGroup, cConfigArray, cConfigList);
+ aConfigSettings = rb_ary_plus(aConfigScalars, aConfigAggregates);
+
+ rb_define_const(cConfig, "SCALARS", aConfigScalars);
+ rb_define_const(cConfig, "AGGREGATES", aConfigAggregates);
+ rb_define_const(cConfig, "SETTINGS", aConfigSettings);
+
+ char* settingNameRegexp = "^[A-Za-z*][A-Za-z\\-_*]*$";
+ rSettingNameRegexp = rb_reg_new(settingNameRegexp, strlen(settingNameRegexp), 0);
+
+ eConfigParseError = rb_define_class("ConfigParseError", rb_eException);
+ eSettingNotFoundError = rb_define_class("SettingNotFoundError", rb_eException);
+ eSettingFormatError = rb_define_class("SettingFormatError", rb_eException);
+ eSettingNameError = rb_define_class("SettingNameError", rb_eException);
+}
diff --git a/contrib/ls-config/LICENSE b/contrib/ls-config/LICENSE
new file mode 100644
index 0000000..85c08c5
--- /dev/null
+++ b/contrib/ls-config/LICENSE
@@ -0,0 +1,339 @@
+GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ Simple program to use libconfig9 configuration files in bash scripts
+ Copyright (C) 2013 lucas-net-pl
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ {signature of Ty Coon}, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/contrib/ls-config/README.md b/contrib/ls-config/README.md
new file mode 100644
index 0000000..3f08515
--- /dev/null
+++ b/contrib/ls-config/README.md
@@ -0,0 +1,21 @@
+ls-config
+=========
+
+Simple program to use libconfig9 configuration files in bash scripts
+
+You can use libconfig9 files directly by invoking ls-config, or in bash scripts
+by sourcing lslib-core and then using simple cfg_* functions. In this case
+You must set LS_EXEC to 1 before sourcing lslib-core
+
+Existing error codes available in: doc/ folder.
+
+Sample usage available in: sample/ folder.
+
+Languages:
+- english
+- polish
+
+We need some help to build packaging for different systems, and with translations
+to other languages.
+
+Full changelog available in doc/changelog.txt
diff --git a/contrib/ls-config/debian/README b/contrib/ls-config/debian/README
new file mode 100644
index 0000000..6b2318f
--- /dev/null
+++ b/contrib/ls-config/debian/README
@@ -0,0 +1,9 @@
+The Debian Package ls-config
+----------------------------
+
+This package allow to use libconfig9 style configuration files
+in bash scripts
+
+Comments regarding the Package
+
+ -- Łukasz A. Grabowski <www@lucas.net.pl> Fri, 11 Oct 2013 21:07:07 +0200
diff --git a/contrib/ls-config/debian/changelog b/contrib/ls-config/debian/changelog
new file mode 100644
index 0000000..051f81b
--- /dev/null
+++ b/contrib/ls-config/debian/changelog
@@ -0,0 +1,5 @@
+ls-config (1.0.3) stable; urgency=low
+
+ * Initial Release.
+
+ -- Łukasz A. Grabowski <www@lucas.net.pl> Fri, 11 Oct 2013 21:07:07 +0200
diff --git a/contrib/ls-config/debian/compat b/contrib/ls-config/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/contrib/ls-config/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/contrib/ls-config/debian/control b/contrib/ls-config/debian/control
new file mode 100644
index 0000000..76b3a3c
--- /dev/null
+++ b/contrib/ls-config/debian/control
@@ -0,0 +1,17 @@
+Source: ls-config
+Section: main
+Priority: standard
+Maintainer: Łukasz A. Grabowski <www@lucas.net.pl>
+Build-Depends: debhelper (>= 8.0.0), libconfig9
+Standards-Version: 3.9.3
+Homepage: http://www.lucas.net.pl
+Vcs-Git: https://github.com/lucas-net-pl/ls-config.git
+Vcs-Browser: https://github.com/lucas-net-pl/ls-config
+
+Package: ls-config
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Simple program allo use libconfig style conf in bash
+ This software allo to use libconfig9 style configuration files
+ in bash scripts by invoke this soft. It contain bash library too,
+ witch easying this job.
diff --git a/contrib/ls-config/debian/copyright b/contrib/ls-config/debian/copyright
new file mode 100644
index 0000000..d0d8adf
--- /dev/null
+++ b/contrib/ls-config/debian/copyright
@@ -0,0 +1,33 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: ls-config
+Source: https://github.com/lucas-net-pl/ls-config
+
+Files: *
+Copyright: 2013 Łukasz A. Grabowski <www@lucas.net.pl>
+License: GPL-2.0+
+
+Files: debian/*
+Copyright: 2013 Łukasz A. Grabowski <www@lucas.net.pl>
+License: GPL-2.0+
+
+License: GPL-2.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+# Please avoid to pick license terms that are more restrictive than the
+# packaged work, as it may make Debian's contributions unacceptable upstream.
diff --git a/contrib/ls-config/debian/files b/contrib/ls-config/debian/files
new file mode 100644
index 0000000..1d67630
--- /dev/null
+++ b/contrib/ls-config/debian/files
@@ -0,0 +1 @@
+ls-config_1.0.3_i386.deb main standard
diff --git a/contrib/ls-config/debian/ls-config.1 b/contrib/ls-config/debian/ls-config.1
new file mode 100644
index 0000000..d5a404a
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config.1
@@ -0,0 +1,103 @@
+.\"Created with GNOME Manpages Editor
+.\"https://github.com/lucas-net-pl/ls-config
+
+.\"Replace <program> with the program name, x with the Section Number
+.TH ls-config x "1" "" "Linux User's Manual"
+
+.SH NAME
+ls-config \- program to use libconfig9 configuration files in bash scripts
+
+..SH SYNOPSIS
+.B ls-config
+[\fB\-f\fR \fIFILE\fR]
+.RI [ options ]
+.br
+
+.SH DESCRIPTION
+You can use libcongig9 files directly invoking ls-config.
+
+Remember to call ls-config always with -f parameter,
+wich give ls-config inormation wich config file use.
+
+Then this program operate in three based modes:
+-g (get) for reading values (default)
+-s (set) for store values
+-h (help) for display help message
+both parameter (-g and -s) nedd to give it variable path
+(internal configuration variable path)
+
+.SH OPTIONS
+.TP
+.BR \-f ", " \-\-file =\fIFILE\fR
+Configuration file to handle.
+.TP
+.BR \-s ", " \-\-set =\fIPATH\fR
+Set configuration variable of given path.
+.TP
+.BR \-d ", " \-\-data =\fIDATA\fR
+Configuration variable value (only with -s)
+.TP
+.BR \-p ", " \-\-type =\fITYPE\fR
+Configuration value type
+.TP
+.BR \-g ", " \-\-get =\fIPATH\fR
+Get configuration variable of given path.
+.TP
+.BR \-n ", " \-\-names
+Printout variables names.
+.TP
+.BR \-t ", " \-\-types
+ Printout variables types.
+.TP
+.BR \-v ", " \-\-values
+Printout variables values.
+.TP
+.BR \-i ", " \-\-indexes
+Printout variables indexes.
+.TP
+.BR \-c ", " \-\-count
+Printout elements count (only: array, list, group).
+.TP
+.BR \-b ", " \-\-bool\-string
+Printout boolean variables as text.
+.TP
+.BR \-q ", " \-\-quiet
+ Quiet output to use in scripts.
+.TP
+.BR \-h ", " \-\-help
+Print this help message.
+.TP
+Variable \fITYPE\fRs:
+ group - variables group,
+ array - array of variables,
+ list - list of variables,
+ int - integer number,
+ int64 - 64bit integer number,
+ float - float point number,
+ bool - boolean value,
+ string - character string.
+
+.SH NOTES
+
+Exiting eerror codes:
+
+ 0 - exit with no error
+ 1 - Cen't access witch right mode (read or write) configuration file.
+ 2 - (not used),
+ 3 - Variable of given path not found (path not found).
+ 4 - Variable path not given.
+ 5 - Can't remove root element (cused if someone try to unset it)
+ 6 - Can't find parent element
+ 7 - Variable unset failed.
+ 8 - Configuration file write failed.
+ 9 - Variable value not given.
+ 10 - Inconsistent value type (caused if set exisitng variablen and give type another then saved).
+ 11 - Variable set failed.
+ 12 - Incorrect data format.
+ 13 - Variable type not given (in som cases tu set variable, giving his type are necesery).
+ 14 - Inlegal data type (caused if user give type thet not known for libconfig9).
+ 15 - Bad name of variable (curently chcecking only if enpty stringa are given).
+ 16 - Inavlid configuration variable path.
+ 17 - New named configuration variable can be added only to group element.
+ 18 - Prohibited data type (caused when use type then connot be use in given case).
+
diff --git a/contrib/ls-config/debian/ls-config.debhelper.log b/contrib/ls-config/debian/ls-config.debhelper.log
new file mode 100644
index 0000000..ce685bc
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config.debhelper.log
@@ -0,0 +1,48 @@
+dh_auto_configure
+dh_auto_build
+dh_auto_test
+dh_prep
+dh_installdirs
+dh_auto_install
+dh_install
+dh_installdocs
+dh_installchangelogs
+dh_installexamples
+dh_installman
+dh_installcatalogs
+dh_installcron
+dh_installdebconf
+dh_installemacsen
+dh_installifupdown
+dh_installinfo
+dh_pysupport
+dh_installinit
+dh_installmenu
+dh_installmime
+dh_installmodules
+dh_installlogcheck
+dh_installlogrotate
+dh_installpam
+dh_installppp
+dh_installudev
+dh_installwm
+dh_installxfonts
+dh_installgsettings
+dh_bugfiles
+dh_ucf
+dh_lintian
+dh_gconf
+dh_icons
+dh_perl
+dh_usrlocal
+dh_link
+dh_compress
+dh_fixperms
+dh_strip
+dh_makeshlibs
+dh_shlibdeps
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb
+dh_builddeb
diff --git a/contrib/ls-config/debian/ls-config.install b/contrib/ls-config/debian/ls-config.install
new file mode 100644
index 0000000..fe2d035
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config.install
@@ -0,0 +1,6 @@
+ls-config usr/share/ls/lib/
+lslib-core usr/share/ls/lib/
+src/locale/* usr/share/locale/
+doc/* usr/share/doc/ls-config/
+sample/* usr/share/doc/ls-config/sample/
+README.md usr/share/doc/ls-config/README.txt \ No newline at end of file
diff --git a/contrib/ls-config/debian/ls-config.substvars b/contrib/ls-config/debian/ls-config.substvars
new file mode 100644
index 0000000..abd3ebe
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config.substvars
@@ -0,0 +1 @@
+misc:Depends=
diff --git a/contrib/ls-config/debian/ls-config/DEBIAN/control b/contrib/ls-config/debian/ls-config/DEBIAN/control
new file mode 100644
index 0000000..a931f92
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config/DEBIAN/control
@@ -0,0 +1,12 @@
+Package: ls-config
+Version: 1.0.3
+Architecture: i386
+Maintainer: Łukasz A. Grabowski <www@lucas.net.pl>
+Installed-Size: 27
+Section: unknown
+Priority: extra
+Homepage: http://www.lucas.net.pl
+Description: Simple program allo use libconfig style conf in bash
+ This software allo to use libconfig9 style configuration files
+ in bash scripts by invoke this soft. It contain bash library too,
+ witch easying this job.
diff --git a/contrib/ls-config/debian/ls-config/DEBIAN/md5sums b/contrib/ls-config/debian/ls-config/DEBIAN/md5sums
new file mode 100644
index 0000000..9362fd5
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config/DEBIAN/md5sums
@@ -0,0 +1,2 @@
+17ee68fa6924ad7f69ca91bee808281b usr/share/doc/ls-config/changelog.gz
+962fc567b180716388e62add5c6bfae5 usr/share/doc/ls-config/copyright
diff --git a/contrib/ls-config/debian/ls-config/DEBIAN/postinst b/contrib/ls-config/debian/ls-config/DEBIAN/postinst
new file mode 100755
index 0000000..9b2ee7b
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config/DEBIAN/postinst
@@ -0,0 +1,39 @@
+#!/bin/sh
+# postinst script for ls-config
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+
+
+exit 0
diff --git a/contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/changelog.gz b/contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/changelog.gz
new file mode 100644
index 0000000..4a16b74
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/changelog.gz
Binary files differ
diff --git a/contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/copyright b/contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/copyright
new file mode 100644
index 0000000..d0d8adf
--- /dev/null
+++ b/contrib/ls-config/debian/ls-config/usr/share/doc/ls-config/copyright
@@ -0,0 +1,33 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: ls-config
+Source: https://github.com/lucas-net-pl/ls-config
+
+Files: *
+Copyright: 2013 Łukasz A. Grabowski <www@lucas.net.pl>
+License: GPL-2.0+
+
+Files: debian/*
+Copyright: 2013 Łukasz A. Grabowski <www@lucas.net.pl>
+License: GPL-2.0+
+
+License: GPL-2.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
+# Please avoid to pick license terms that are more restrictive than the
+# packaged work, as it may make Debian's contributions unacceptable upstream.
diff --git a/contrib/ls-config/debian/manpages b/contrib/ls-config/debian/manpages
new file mode 100644
index 0000000..6672d62
--- /dev/null
+++ b/contrib/ls-config/debian/manpages
@@ -0,0 +1 @@
+debian/ls-config.1
diff --git a/contrib/ls-config/debian/postinst b/contrib/ls-config/debian/postinst
new file mode 100644
index 0000000..ba5d0df
--- /dev/null
+++ b/contrib/ls-config/debian/postinst
@@ -0,0 +1,68 @@
+#!/bin/sh
+# postinst script for ls-config
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+config_path() {
+ local CHK="$(echo ":$PATH:" | grep ":/usr/share/ls/lib:")"
+ if [ "$CHK" != "" ]; then
+ return 0;
+ fi;
+ local BIFS="$IFS"
+ IFS=$'\n'
+ local PR="$(</etc/profile)"
+ local NF=""
+ local L
+ for L in $PR
+ do
+ CHK="$(echo "$L" | sed -E 's/^([\ \t]+)//g')"
+ CHK="${CHK:0:5}"
+ NF="$NF$IFS$L"
+ if [ "$CHK" = "PATH=" ]; then
+ NF="$NF$IFS#Configuration path for ls scripting"
+ NF="$NF$IFS"
+ NF="${NF}PATH=\"\$PATH:/usr/share/ls/lib\"$IFS"
+ fi;
+ done
+ NF="$NF$IFS"
+ IFS="$BIFS"
+ echo "$NF" > /etc/profile
+}
+
+case "$1" in
+ configure)
+ if [ ! -e "/etc/ls" ]; then
+ mkdir -p "/etc/ls/"
+ config_path
+ fi;
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/contrib/ls-config/debian/rules b/contrib/ls-config/debian/rules
new file mode 100755
index 0000000..b760bee
--- /dev/null
+++ b/contrib/ls-config/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
diff --git a/contrib/ls-config/debian/source/format b/contrib/ls-config/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/contrib/ls-config/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/contrib/ls-config/doc/bash.api.txt b/contrib/ls-config/doc/bash.api.txt
new file mode 100644
index 0000000..762f600
--- /dev/null
+++ b/contrib/ls-config/doc/bash.api.txt
@@ -0,0 +1,75 @@
+Instalation:
+------------
+
+First of all, You must place ls-config binary and lslib-core bash
+script in the same directory (default: /usr/share/ls/lib)
+
+Next in lslib-core header chcange configuration:
+PACD tu point to parent directory of paced files
+then LIBD must point relative (tu PACD) to directory
+whrere script placed
+
+Usage:
+------
+
+In You bash script, first of all define LS_EXEC variable,
+and set his value to 1. (It protect lslib-core) to run
+standalone
+
+Next, source library:
+source /usr/share/ls/lib/lslib-core
+
+After thet You can use following function:
+
+Functions:
+----------
+
+cfg_g $PATH - this echo variable value of given PATH
+ and return error code
+cfg_t $PATH - this echo variable type of given PATH
+ and return error code
+cfg_c $PATH - this echo cout of variable elements
+ and return error code
+cfg_s $PATH $DATA [$TYPE] - this set variable of given PATH or create new
+ variable valuse are set to DATA, and if this
+ create new variable, variable will be type TYPE
+cfg_u $PATH - this unset (remove) variable of given PATH
+ and return error code
+cfg_f_g $FILE $PATH - same as cfg_g, but operate on given FILE
+cfg_f_t $FILE $PATH - same as cfg_t, but operate on given FILE
+cfg_f_c $FILE $PATH - same as cfg_c, but operate on given FILE
+cfg_f_s $FILE $PATH $DATA [$TYPE] - same as cfg_s, but operate on given FILE
+cfg_f_u $FILE $PATH - same as cfg_u, but operate on given FILE
+
+Configuration files:
+--------------------
+
+By default configuration file are placed in /etc/ls/
+with the same name as script file name
+(used in cfg_g, cfg_t, cfg_c, cfg_s, cfg_u)
+
+But if You need, You can use any location of configuration file
+by using cfg_f_* functions, giving configuration file location as
+first argument
+
+Detailed configuration file shema are publicated on:
+http://www.hyperrealm.com/libconfig/
+And his gramar on:
+http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
+
+there are only short describe:
+configuration = setting-list | empty
+setting-list = setting | setting-list setting
+setting = name (":" | "=") value (";" | "," | empty)
+value = scalar-value | array | list | group
+value-list = value | value-list "," value
+scalar-value = boolean | integer | integer64 | hex | hex64 | float | string
+scalar-value-list = scalar-value | scalar-value-list "," scalar-value
+array = "[" (scalar-value-list | empty) "]"
+list = "(" (value-list | empty) ")"
+group = "{" (setting-list | empty) "}"
+empty =
+
+smaple configuration file and script are available on sample/ directory
+config - samble configuration file
+script - sample script, then read info variable from config file
diff --git a/contrib/ls-config/doc/bin.api.txt b/contrib/ls-config/doc/bin.api.txt
new file mode 100644
index 0000000..55baaf2
--- /dev/null
+++ b/contrib/ls-config/doc/bin.api.txt
@@ -0,0 +1,75 @@
+Instalation:
+------------
+
+First place somewhere ls-config binary, or make it from source
+
+Then if You woud like use it with national translation, then You muas build
+it form source and then copy *.mo files according to You system
+
+Usage:
+------
+
+Remember to call ls-config always with -f parameter,
+wich give ls-config inormation wich config file use.
+
+Then this program operate in three based modes:
+-g (get) for reading values (default)
+-s (set) for store values
+-h (help) for display help message
+both parameter (-g and -s) nedd to give it variable path
+(internal configuration variable path)
+
+for exapmle read info value from config file:
+ls-config -f config -g info
+
+Then You can set this value to another
+ls-config -f config -s info -d "Somethint to write"
+
+But when You wand to addn new configutation variable you must
+specify his type:
+ls-config -f config -s someint -d 10 -p int
+
+You can remove (unset) variable too. This is subfunstion of setting:
+ls-config -f config -s someint -u
+
+When reading You cent use following flag:
+-v - read only variable valut
+-t - read only variable type
+-c - read only variable element count (sense only in types: array, list, group)
+-i - read only variable index (sense only in type: array, list)
+-n - read only variable name
+
+and sometimes usable
+-q - to wori in quiet mode usable in scripts.
+
+For example to read variable somevar type, where variable in group foo:
+ls-config -f config -g "foo.somevar" -t
+
+For detailed list of parametera (long options available too) run ls-config
+in help mode:
+ls-config -h
+
+Configuraiton files:
+--------------------
+
+Detailed configuration file shema are publicated on:
+http://www.hyperrealm.com/libconfig/
+And his gramar on:
+http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
+
+there are only short describe:
+configuration = setting-list | empty
+setting-list = setting | setting-list setting
+setting = name (":" | "=") value (";" | "," | empty)
+value = scalar-value | array | list | group
+value-list = value | value-list "," value
+scalar-value = boolean | integer | integer64 | hex | hex64 | float | string
+scalar-value-list = scalar-value | scalar-value-list "," scalar-value
+array = "[" (scalar-value-list | empty) "]"
+list = "(" (value-list | empty) ")"
+group = "{" (setting-list | empty) "}"
+empty =
+
+smaple configuration file and script are available on sample/ directory
+config - samble configuration file
+script - sample script, then read info variable from config file
diff --git a/contrib/ls-config/doc/changlog.txt b/contrib/ls-config/doc/changlog.txt
new file mode 100644
index 0000000..937e737
--- /dev/null
+++ b/contrib/ls-config/doc/changlog.txt
@@ -0,0 +1,26 @@
+Version 1.0.3
+-------------
+
+Fully commented code,
+Startin with documentation
+
+bugfixes
+- fix some badly returned exit codes
+- remove duplicate error messages
+- l10n textdomain corrected
+- extend sample configuration file to be full representative
+- some corrections in sample script (adding directly usaga)
+
+new features
+- adding documentation files (api)
+
+Version 1.0.1
+-------------
+
+Internaly translated tu englich
+
+
+Verison 1.0.0
+-------------
+
+First publicated and working version \ No newline at end of file
diff --git a/contrib/ls-config/doc/errorcodes.txt b/contrib/ls-config/doc/errorcodes.txt
new file mode 100644
index 0000000..303ef58
--- /dev/null
+++ b/contrib/ls-config/doc/errorcodes.txt
@@ -0,0 +1,20 @@
+ 0 - exit with no error
+ 1 - Cen't access witch right mode (read or write) configuration file.
+ 2 - (not used),
+ 3 - Variable of given path not found (path not found).
+ 4 - Variable path not given.
+ 5 - Can't remove root element (cused if someone try to unset it)
+ 6 - Can't find parent element
+ 7 - Variable unset failed.
+ 8 - Configuration file write failed.
+ 9 - Variable value not given.
+10 - Inconsistent value type (caused if set exisitng variablen and give type another then saved).
+11 - Variable set failed.
+12 - Incorrect data format.
+13 - Variable type not given (in som cases tu set variable, giving his type are necesery).
+14 - Inlegal data type (caused if user give type thet not known for libconfig9).
+15 - Bad name of variable (curently chcecking only if enpty stringa are given).
+16 - Inavlid configuration variable path.
+17 - New named configuration variable can be added only to group element.
+18 - Prohibited data type (caused when use type then connot be use in given case).
+
diff --git a/contrib/ls-config/lslib-core b/contrib/ls-config/lslib-core
new file mode 100644
index 0000000..6ef21fa
--- /dev/null
+++ b/contrib/ls-config/lslib-core
@@ -0,0 +1,199 @@
+#!/bin/bash
+
+#title :lslib-core
+#description :core library for LS scripts
+#author :Łukasz A. Grabowski <www@lucas.net.pl>
+#date :20130928
+#version :1.0.3
+#notes :
+#bash_version :4.2.37(1)-release
+#copywrite :Copyright (C) 2013 Łukasz A. Grabowski
+#license :This program is free software: you can redistribute
+# :it and/or modify it under the terms of the GNU General
+# :Public License as published by the Free Software
+# :Foundation, either version 2 of the License or
+# :any later version.
+# :
+# :This program is distributed in the hope that it will
+# :be useful, but WITHOUT ANY WARRANTY; without even the
+# :implied warranty of MERCHANTABILITY or FITNESS FOR
+# :A PARTICULAR PURPOSE. See the GNU General Public
+# :License for more details.
+# :
+# :You should have received a copy of the GNU General
+# :Public License along with this program. If not, see
+# :http://www.gnu.org/licenses/.
+#=======================================================================
+
+#################
+# Configuration #
+#################
+
+PACD="/usr/share/ls" #main directory for LS scripts
+LIBD="lib" #library dir for LS scripts
+
+#######################
+# Predefined and init #
+#######################
+
+if [ -z "$LS_EXEC" ]; then
+ echo "This script are only for inclusion in LS packet scripts. Don't use it itself." 1>&2
+ exit 1
+fi
+
+##############################
+# configuration read / write #
+##############################
+
+#get configuration
+# cfg_g PATH
+cfg_g() {
+ local PTH=""
+ if [ $# -gt 0 ]; then
+ local PTH="$1";
+ fi;
+ local DAT
+ local ERR
+ DAT="$($PACD/$LIBD/ls-config -f "$CFGFN" -qv --get="$PTH")"
+ ERR=$?
+ echo "$DAT"
+ return $ERR
+}
+
+#get configuration type
+# cfg_t PATH
+cfg_t() {
+ local PTH=""
+ if [ $# -gt 0 ]; then
+ local PTH="$1";
+ fi;
+ local DAT
+ local ERR
+ DAT="$($PACD/$LIBD/ls-config -f "$CFGFN" -qt --get="$PTH")"
+ ERR=$?
+ echo "$DAT"
+ return $ERR
+}
+
+#get configuration items count
+# cfg_c PATH
+cfg_c() {
+ local PTH=""
+ if [ $# -gt 0 ]; then
+ local PTH="$1";
+ fi;
+ local DAT
+ local ERR
+ DAT="$($PACD/$LIBD/ls-config -f "$CFGFN" -qc --get="$PTH")"
+ ERR=$?
+ echo "$DAT"
+ return $ERR
+}
+
+#set configuration
+# cfg_s PATH DATA [TYPE=string]
+cfg_s() {
+ local PTH=""
+ if [ $# -gt 0 ]; then
+ local PTH="$1";
+ fi;
+ local DATA=""
+ if [ $# -gt 1 ]; then
+ local DATA="$2";
+ fi;
+ local TYPE="string"
+ if [ $# -gt 2 ]; then
+ local TYPE="$3";
+ fi;
+ local DAT
+ local ERR
+ DAT="$($PACD/$LIBD/ls-config -f "$CFGFN" -q --set="$PTH" --data="$DATA" --type="$TYPE")"
+ ERR=$?
+ echo "$DAT"
+ return $ERR
+}
+
+#remove configuration
+# cfg_u PATH
+cfg_u() {
+ local PTH=""
+ if [ $# -gt 0 ]; then
+ local PTH="$1";
+ fi;
+ local DAT
+ local ERR
+ DAT="$($PACD/$LIBD/ls-config -f "$CFGFN" -q --set="$PTH" --unset)"
+ ERR=$?
+ return $ERR
+}
+
+cfg_f_g() {
+ local BCFN="$CFGFN"
+ local EX
+ CFGFN="$1"
+ shift
+ cfg_g "$@"
+ EX=$?
+ CFGFN="$BCFN"
+ return $EX
+}
+
+cfg_f_t() {
+ local BCFN="$CFGFN"
+ local EX
+ CFGFN="$1"
+ shift
+ cfg_t "$@"
+ EX=$?
+ CFGFN="$BCFN"
+ return $EX
+}
+
+cfg_f_c() {
+ local BCFN="$CFGFN"
+ local EX
+ CFGFN="$1"
+ shift
+ cfg_c "$@"
+ EX=$?
+ CFGFN="$BCFN"
+ return $EX
+}
+
+cfg_f_s() {
+ local BCFN="$CFGFN"
+ local EX
+ CFGFN="$1"
+ shift
+ cfg_s "$@"
+ EX=$?
+ CFGFN="$BCFN"
+ return $EX
+}
+
+cfg_f_u() {
+ local BCFN="$CFGFN"
+ local EX
+ CFGFN="$1"
+ shift
+ cfg_u "$@"
+ EX=$?
+ CFGFN="$BCFN"
+ return $EX
+}
+
+
+######################
+# base variable init #
+######################
+
+#package name
+SCRFN="$(basename "$0")"
+
+#configuriation directory and file
+if [ -z "$CFGD" ]; then
+ CFGD="/etc/ls"
+fi;
+CFGFN="$CFGD/$SCRFN"
+
+
diff --git a/contrib/ls-config/makefile b/contrib/ls-config/makefile
new file mode 100644
index 0000000..7f20267
--- /dev/null
+++ b/contrib/ls-config/makefile
@@ -0,0 +1,7 @@
+all:
+ make -C src
+
+clean:
+ make -C src clean
+
+
diff --git a/contrib/ls-config/sample/config b/contrib/ls-config/sample/config
new file mode 100644
index 0000000..abe7dda
--- /dev/null
+++ b/contrib/ls-config/sample/config
@@ -0,0 +1,23 @@
+grp :
+{
+ value = 10;
+ name = "sample";
+};
+lst = (
+ {
+ name = "sample";
+ },
+ {
+ comment = "sample secong group";
+ val = 10.2;
+ } );
+info = "more info about types in libconfig9 documentations";
+arr = [ 10, 20, 30 ];
+integer = 100;
+longint = 100L;
+flo = 100.01;
+boolean :
+{
+ truevalue = true;
+ falsevalue = false;
+};
diff --git a/contrib/ls-config/sample/script b/contrib/ls-config/sample/script
new file mode 100755
index 0000000..70fe124
--- /dev/null
+++ b/contrib/ls-config/sample/script
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+#title :script
+#description :this script only demonstrate usage of ls-config
+#author :Łukasz A. Grabowski <www@lucas.net.pl>
+#date :20130928
+#version :1.0.3
+#notes :This only read one value from configuration file
+# :this script MUST be run from subdirectory of dir
+# :where ls-config (bin) and lslib-core are stored
+# :to place script in other places You must reconfigure paths
+#bash_version :4.2.37(1)-release
+#copywrite :Copyright (C) 2013 Łukasz A. Grabowski
+#license :This program is free software: you can redistribute
+# :it and/or modify it under the terms of the GNU General
+# :Public License as published by the Free Software
+# :Foundation, either version 2 of the License or
+# :any later version.
+# :
+# :This program is distributed in the hope that it will
+# :be useful, but WITHOUT ANY WARRANTY; without even the
+# :implied warranty of MERCHANTABILITY or FITNESS FOR
+# :A PARTICULAR PURPOSE. See the GNU General Public
+# :License for more details.
+# :
+# :You should have received a copy of the GNU General
+# :Public License along with this program. If not, see
+# :http://www.gnu.org/licenses/.
+#=======================================================================
+
+
+#set app flag
+LS_EXEC=1
+
+#set configuration directory
+CFGD="./"
+
+#source bash library to manipulate config
+source ../lslib-core
+
+#path direcrories onlny for this sample
+PACD="../"
+LIBD=""
+#end path
+
+#read data from configuration file
+TEST=$(cfg_f_g "config" "info")
+ERR="$?"
+
+#show data
+echo "Info value: $TEST"
+echo "Reading error: $ERR"
+
+#show other method of reading value:
+
+#output space and info
+echo ""
+echo "Reading using binary:"
+
+#read data from configuration file
+TEST=$(${PACD}ls-config -f config --get="info" -vq)
+ERR="$?"
+
+#show data
+echo "Info value: $TEST"
+echo "Reading error: $ERR"
+
+exit 0;
diff --git a/contrib/ls-config/src/ls-config.c b/contrib/ls-config/src/ls-config.c
new file mode 100644
index 0000000..4db8966
--- /dev/null
+++ b/contrib/ls-config/src/ls-config.c
@@ -0,0 +1,1345 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <locale.h>
+#include <libintl.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <math.h>
+#include <libconfig.h>
+
+#define PACKAGE "LS bash config"
+#define VERSION "1.0.3"
+
+// global flags
+struct flags {
+ int quiet; //quiet output
+ int names; //set for printout config variables names
+ int types; //set for printout config variables types
+ int values; //set for printout config variables values
+ int indexes; //set for printout config variables indexes
+ int counter; //set for printout config varibales counting (for grout, list, array. in other cases it return 1)
+ int unset; //unset valriable
+ int boolstring; //set for output bool variable (0|1) as test (false|true)
+ int mode; //1 - for setting variable, 0 - for get hist data
+ int error; //error status handling
+};
+
+//take valur from input and comvert it to int
+//TODO: Read long too
+int getNumber() {
+ char buf[1000];
+ int test,val;
+ unsigned int inp;
+ fgets(buf, sizeof buf, stdin);
+ test = sscanf(buf, "%u", &inp);
+ val = (int) inp;
+ if(val < 0) val *= -1;
+ if(test > 0) return val;
+ return (int) 0;
+}
+
+//printout help messsage
+void printHelp() {
+ printf(gettext("Configuration file handling\n"));
+ printf("\n");
+ printf(gettext("Usage: ls-config [OPTION]\n"));
+ printf(gettext("Reading and writening data from configuration files\n"));
+ printf(gettext("in libconfig9 format.\n"));
+ printf("\n");
+ printf(gettext("CAUTION: using without given config file are cause error!\n"));
+ printf("\n");
+ printf(gettext("Available options:\n"));
+ printf(gettext(" -f, --file=FILE Configuration file to handle.\n"));
+ printf("\n");
+ printf(gettext(" -s, --set=PATH Set configuration variable of given path.\n"));
+ printf(gettext(" -d, --data=DATA Configuration variable value (only with -s)\n"));
+ printf(gettext(" -p, --type=TYPE Configuration value type\n"));
+ printf("\n");
+ printf(gettext(" -g, --get=PATH Get configuration variable of given path.\n"));
+ printf(gettext(" -n, --names Printout variables names.\n"));
+ printf(gettext(" -t, --types Printout variables types.\n"));
+ printf(gettext(" -v, --values Printout variables values.\n"));
+ printf(gettext(" -i, --indexes Printout variables indexes.\n"));
+ printf(gettext(" -c, --count Printout elements count (only: array, list, group).\n"));
+ printf(gettext(" -b, --bool-string Printout boolean variables as text.\n"));
+ printf("\n");
+ printf(gettext(" -q, --quiet Quiet output to use in scripts.\n"));
+ printf(gettext(" -h, --help Print this help message.\n"));
+ printf("\n");
+ printf(gettext("TYPE: Variable types:\n"));
+ printf(gettext(" group - variables group,\n"));
+ printf(gettext(" array - array of variables,\n"));
+ printf(gettext(" list - list of variables,\n"));
+ printf(gettext(" int - integer number,\n"));
+ printf(gettext(" int64 - 64bit integer number,\n"));
+ printf(gettext(" float - float point number,\n"));
+ printf(gettext(" bool - boolean value,\n"));
+ printf(gettext(" string - character string.\n"));
+ printf("\n");
+ printf("(c) 2013 by LucaS web sutio - http://www.lucas.net.pl\n");
+ printf("Author: Łukasz A. Grabowski\n");
+ printf(gettext("Licence: "));
+ printf("GPL v2.\n");
+ exit(0);
+};
+
+//set configuration int value
+int set_config_int(config_setting_t *setting, char *dataString, struct flags optflags) {
+ long bufl; //int (long) to get from input data string
+ int buf, scs; //config int, success status
+ char *erp; //error output
+
+ //convert input data to int
+ errno = 0;
+ bufl = strtol(dataString, &erp, 0);
+ if(((errno == ERANGE && (bufl == LONG_MAX || bufl == LONG_MIN)) || (errno != 0 && bufl == 0)) || (erp == dataString) || bufl > INT_MAX || bufl < INT_MIN) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n"));
+ return 12;
+ };
+ buf = (int)bufl;
+
+ //set configuration variable
+ scs = config_setting_set_int(setting, buf);
+ if(scs == CONFIG_FALSE) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ return 0;
+};
+
+//set configuration int64 value
+int set_config_int64(config_setting_t *setting, char *dataString, struct flags optflags) {
+ long bufl; //long to get from input data string
+ int scs; //success status
+ char *erp; //error output
+
+ //convert input data to long
+ errno = 0;
+ bufl = strtol(dataString, &erp, 0);
+ if(((errno == ERANGE && (bufl == LONG_MAX || bufl == LONG_MIN)) || (errno != 0 && bufl == 0)) || (erp == dataString)) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n"));
+ return 12;
+ };
+
+ //set configuration variable
+ scs = config_setting_set_int64(setting, bufl);
+ if(scs == CONFIG_FALSE) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ return 0;
+};
+
+//set configuration float value
+int set_config_float(config_setting_t *setting, char *dataString, struct flags optflags) {
+ double buff; //double (float) to get from input data string
+ int scs; //success status
+ char *erp; //error output
+
+ //convert input data to double
+ errno = 0;
+ buff = strtod(dataString, &erp);
+ if(((errno == ERANGE && (buff == HUGE_VALF || buff == HUGE_VALL)) || (errno != 0 && buff == 0)) || (erp == dataString)) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n"));
+ return 12;
+ }
+
+ //set configuration variable
+ scs = config_setting_set_float(setting, buff);
+ if(scs == CONFIG_FALSE) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ return 0;
+};
+
+//set configuration boolean value
+int set_config_bool(config_setting_t *setting, char *dataString, struct flags optflags) {
+ int scs, buf; //success status, input convert burrer
+
+ //convert input data
+ //chceck both 1/0 and true/false string
+ buf = -1;
+ if(!strcmp(dataString, "1") || !strcmp(dataString, "true") || !strcmp(dataString, "TRUE")) buf = 1;
+ if(!strcmp(dataString, "0") || !strcmp(dataString, "false") || !strcmp(dataString, "FALSE")) buf = 0;
+ if(buf < 0) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Incorrect data format.\n"));
+ return 12;
+ }
+
+ //set configuration variable
+ scs = config_setting_set_bool(setting, buf);
+ if(scs == CONFIG_FALSE) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ return 0;
+};
+
+//configuratnion variable path look like: foo.bar.car
+//this fuction return string giving path to parent element (foo.bar)
+char* path_parent(char *dataPath) {
+ char *str_ptr, *last_ptr, *newpath, *dot="."; //tokenized buffer, last buffer, new parent path, separator
+ newpath = malloc(1);
+ memset(newpath, 0, 1);
+ last_ptr = malloc(1);
+ memset(last_ptr, 0, 1);
+
+ //tokenize string and save last token
+ str_ptr = strtok(dataPath, ".");
+ last_ptr = (char*)realloc(last_ptr, (strlen(str_ptr)+1)*sizeof(char));
+ strcpy(last_ptr, str_ptr);
+
+ //loop overt path to build new path without last element
+ while(str_ptr != NULL) {
+ str_ptr = strtok(NULL, ".");
+ if(str_ptr != NULL) {
+ if(strlen(last_ptr) > 0 ) {
+ newpath = (char*)realloc(newpath, (strlen(newpath)+strlen(last_ptr)+2)*sizeof(char));
+ strcat(newpath, dot);
+ strcat(newpath, last_ptr);
+ };
+ last_ptr = (char*)realloc(last_ptr, (strlen(str_ptr)+1)*sizeof(char));
+ strcpy(last_ptr, str_ptr);
+ } else {
+ last_ptr = (char*)realloc(last_ptr, (1)*sizeof(char));
+ memset(last_ptr, 0, 1);
+ };
+ };
+ free(dataPath);
+
+ //if new path empty thren return null
+ if(strlen(newpath) == 0) {
+ free(newpath);
+ newpath = NULL;
+ };
+ return newpath;
+};
+
+//get element name from configuration variable path
+//e.g.: from foo.bar return bar
+char* path_name(char *dataPath) {
+ char *str_ptr, *name, *tk; //tokenized buffer, element name, copy of dataPath
+ name = malloc(1);
+
+ //make copy of dataPath
+ tk = malloc((strlen(dataPath)+1)*sizeof(char));
+ memset(name, 0, 1);
+ strcpy(tk, dataPath);
+
+ //tokenize dataPath
+ str_ptr = strtok(tk, ".");
+
+ //loop over tokenize pathh to get last element
+ while(str_ptr != NULL) {
+ name = (char*)realloc(name, (strlen(str_ptr)+1)*sizeof(char));
+ strcpy(name, str_ptr);
+ str_ptr = strtok(NULL, ".");
+ };
+ free(tk);
+
+ //if no element name then return null
+ if(strlen(name) == 0) {
+ free(name);
+ name = NULL;
+ };
+ return name;
+};
+
+//set configuration path
+//@return int success
+//@param configFile - name (with path) of configuration fille
+//@param dataPath - path of configuration variable (in config file)
+//@param optflags - global options flags
+//@param dataString - data to store in configuration variable in string format
+//@param dataType - type of variable to save
+int set_config(char *configFile, char *dataPath, struct flags optflags, char *dataString, char *dataType) {
+ config_t cfg; //libcongig configuration handler
+ config_setting_t *setting, *ss; //libconfig element handrer: mant, and subset (uset for multielement types)
+ config_init(&cfg);
+ int scs, dt, dattyp; //sucess statu, data type
+ char *npath; // new variable configuration path path
+
+ //open and read configuration file
+ if(!config_read_file(&cfg, configFile)) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n"));
+ return 1;
+ };
+
+ //if no data path or data string then cause error
+ if(dataPath == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Conviguration variable path not given.\n"));
+ return 4;
+ };
+ if(dataString == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable value not given.\n"));
+ return 9;
+ };
+
+ //find configuration variable of given path
+ setting = config_lookup(&cfg, dataPath);
+ if(setting == NULL) {
+ //if variable of given path not found get element name and partent path,
+ //then try to create it
+ npath = path_name(dataPath);
+ dataPath = path_parent(dataPath);
+ if(dataPath == NULL) {
+ setting = config_root_setting(&cfg);
+ } else {
+ setting = config_lookup(&cfg, dataPath);
+ };
+ if(setting == NULL) {
+ //if parent not exists exit with error
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Inavlid configuration variable path.\n"));
+ return 16;
+ };
+ //chceck type of parent element (named alement can be added only to group element)
+ dt = config_setting_type(setting);
+ if(dt != CONFIG_TYPE_GROUP) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! New named configuration variable can be added only to group element.\n"));
+ return 17;
+ };
+ //check if new element type are given
+ if(dataType == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n"));
+ return 13;
+ };
+ //now get type based on his name
+ if(!strcmp(dataType, "int")) {
+ dattyp = CONFIG_TYPE_INT;
+ } else if(!strcmp(dataType, "int64")) {
+ dattyp = CONFIG_TYPE_INT64;
+ } else if(!strcmp(dataType, "float")) {
+ dattyp = CONFIG_TYPE_FLOAT;
+ } else if(!strcmp(dataType, "string")) {
+ dattyp = CONFIG_TYPE_STRING;
+ } else if(!strcmp(dataType, "bool")) {
+ dattyp = CONFIG_TYPE_BOOL;
+ } else if(!strcmp(dataType, "array")) {
+ dattyp = CONFIG_TYPE_ARRAY;
+ } else if(!strcmp(dataType, "list")) {
+ dattyp = CONFIG_TYPE_LIST;
+ } else if(!strcmp(dataType, "group")) {
+ dattyp = CONFIG_TYPE_GROUP;
+ } else {
+ //if given type no mutch eny then cause error and exit
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Inlegal data type.\n"));
+ return 14;
+ };
+ //add new element to configuration file
+ ss = config_setting_add(setting, npath, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ scs = 0;
+ //and based on new type set his value
+ switch(dattyp) {
+ case CONFIG_TYPE_INT:
+ scs = set_config_int(ss, dataString, optflags);
+ break;
+ case CONFIG_TYPE_INT64:
+ scs = set_config_int64(ss, dataString, optflags);
+ break;
+ case CONFIG_TYPE_FLOAT:
+ scs = set_config_float(ss, dataString, optflags);
+ break;
+ case CONFIG_TYPE_STRING:
+ scs = config_setting_set_string(ss, dataString);
+ if(scs == CONFIG_FALSE) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ scs = 11;
+ } else scs = 0;
+ break;
+ case CONFIG_TYPE_BOOL:
+ scs = set_config_bool(ss, dataString, optflags);
+ break;
+ };
+ if(scs > 0) {
+ //if occurs some error wihe setting variable value exit with error
+ config_destroy(&cfg);
+ return scs;
+ };
+ } else {
+ //but if we found element of given path, try to set his value
+ //first of all determinate type of value
+ dt = config_setting_type(setting);
+ switch(dt) {
+ case CONFIG_TYPE_INT:
+ if(dataType != NULL && strcmp(dataType, "int")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //then set value
+ scs = set_config_int(setting, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_INT64:
+ if(dataType != NULL && strcmp(dataType, "int64")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //then set value
+ scs = set_config_int64(setting, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_FLOAT:
+ if(dataType != NULL && strcmp(dataType, "float")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //then set value
+ scs = set_config_float(setting, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_STRING:
+ if(dataType != NULL && strcmp(dataType, "string")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //then set value
+ scs = config_setting_set_string(setting, dataString);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ break;
+ case CONFIG_TYPE_BOOL:
+ if(dataType != NULL && strcmp(dataType, "bool")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //then set value
+ scs = set_config_bool(setting, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_ARRAY:
+ //if array are empty we can set alement of any scalar type
+ if(config_setting_length(setting) == 0) {
+ //but we must have his type
+ if(dataType == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n"));
+ return 13;
+ };
+ if(!strcmp(dataType, "int")) {
+ dattyp = CONFIG_TYPE_INT;
+ } else if(!strcmp(dataType, "int64")) {
+ dattyp = CONFIG_TYPE_INT64;
+ } else if(!strcmp(dataType, "float")) {
+ dattyp = CONFIG_TYPE_FLOAT;
+ } else if(!strcmp(dataType, "string")) {
+ dattyp = CONFIG_TYPE_STRING;
+ } else if(!strcmp(dataType, "bool")) {
+ dattyp = CONFIG_TYPE_BOOL;
+ } else {
+ //only scalar type availabe
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Prohibited data type.\n"));
+ return 18;
+ };
+ //first of all we must add new element to array
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //then based on his type set value
+ switch(dattyp) {
+ case CONFIG_TYPE_INT:
+ scs = set_config_int(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_INT64:
+ scs = set_config_int64(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_FLOAT:
+ scs = set_config_float(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_STRING:
+ scs = config_setting_set_string(ss, dataString);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ break;
+ case CONFIG_TYPE_BOOL:
+ scs = set_config_bool(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ };
+ } else {
+ //but if we have some element in array, we can add only element of same type
+ //so, because all element in arry must be same type, we get type of first element
+ //and based on it set new element
+ dattyp = config_setting_type(config_setting_get_elem(setting, 0));
+ switch(dattyp) {
+ case CONFIG_TYPE_INT:
+ if(dataType != NULL && strcmp(dataType, "int")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //add new element
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //then set his value
+ scs = set_config_int(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_INT64:
+ if(dataType != NULL && strcmp(dataType, "int64")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //add new element
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //then set his value
+ scs = set_config_int64(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_FLOAT:
+ if(dataType != NULL && strcmp(dataType, "float")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //add new element
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //then set his value
+ scs = set_config_float(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ case CONFIG_TYPE_STRING:
+ if(dataType != NULL && strcmp(dataType, "string")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //add new element
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //then set his value
+ scs = config_setting_set_string(ss, dataString);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ break;
+ case CONFIG_TYPE_BOOL:
+ if(dataType != NULL && strcmp(dataType, "bool")) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! inconsistent value type.\n"));
+ return 10;
+ };
+ //add new element
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //then set his value
+ scs = set_config_bool(ss, dataString, optflags);
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ break;
+ };
+ };
+ break;
+ case CONFIG_TYPE_LIST:
+ //in case adding element to list, we can add any type of element
+ if(dataType == NULL) {
+ //but we must konwn his type
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n"));
+ return 13;
+ };
+ if(!strcmp(dataType, "int")) {
+ dattyp = CONFIG_TYPE_INT;
+ } else if(!strcmp(dataType, "int64")) {
+ dattyp = CONFIG_TYPE_INT64;
+ } else if(!strcmp(dataType, "float")) {
+ dattyp = CONFIG_TYPE_FLOAT;
+ } else if(!strcmp(dataType, "string")) {
+ dattyp = CONFIG_TYPE_STRING;
+ } else if(!strcmp(dataType, "bool")) {
+ dattyp = CONFIG_TYPE_BOOL;
+ } else if(!strcmp(dataType, "array")) {
+ dattyp = CONFIG_TYPE_ARRAY;
+ } else if(!strcmp(dataType, "list")) {
+ dattyp = CONFIG_TYPE_LIST;
+ } else if(!strcmp(dataType, "group")) {
+ dattyp = CONFIG_TYPE_GROUP;
+ } else {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Inlegal data type.\n"));
+ return 14;
+ };
+ //add new element of given type
+ ss = config_setting_add(setting, NULL, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //now, based on type, set element value
+ scs = 0;
+ switch(dattyp) {
+ case CONFIG_TYPE_INT:
+ scs = set_config_int(ss, dataString, optflags);
+ break;
+ case CONFIG_TYPE_INT64:
+ scs = set_config_int64(ss, dataString, optflags);
+ break;
+ case CONFIG_TYPE_FLOAT:
+ scs = set_config_int64(ss, dataString, optflags);
+ break;
+ case CONFIG_TYPE_STRING:
+ scs = config_setting_set_string(ss, dataString);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ scs = 0;
+ break;
+ case CONFIG_TYPE_BOOL:
+ scs = set_config_int64(ss, dataString, optflags);
+ break;
+ };
+ if(scs > 0) {
+ config_destroy(&cfg);
+ return scs;
+ };
+ //finaly outpt index of new added element
+ if(optflags.quiet == 0) {
+ printf(gettext("Added element index: %d\n"), config_setting_index(ss));
+ } else {
+ printf("%d", config_setting_index(ss));
+ };
+ break;
+ case CONFIG_TYPE_GROUP:
+ //to group we can add any type of element, but we must have his name
+ if(dataType == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration variable type not given.\n"));
+ return 13;
+ };
+ if(strlen(dataString) < 1) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Bad name of configuration variable.\n"));
+ return 15;
+ };
+ //determinate type of new variable
+ if(!strcmp(dataType, "int")) {
+ dattyp = CONFIG_TYPE_INT;
+ } else if(!strcmp(dataType, "int64")) {
+ dattyp = CONFIG_TYPE_INT64;
+ } else if(!strcmp(dataType, "float")) {
+ dattyp = CONFIG_TYPE_FLOAT;
+ } else if(!strcmp(dataType, "string")) {
+ dattyp = CONFIG_TYPE_STRING;
+ } else if(!strcmp(dataType, "bool")) {
+ dattyp = CONFIG_TYPE_BOOL;
+ } else if(!strcmp(dataType, "array")) {
+ dattyp = CONFIG_TYPE_ARRAY;
+ } else if(!strcmp(dataType, "list")) {
+ dattyp = CONFIG_TYPE_LIST;
+ } else if(!strcmp(dataType, "group")) {
+ dattyp = CONFIG_TYPE_GROUP;
+ } else {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Inlegal data type.\n"));
+ return 14;
+ };
+ //then add new alement
+ ss = config_setting_add(setting, dataString, dattyp);
+ if(ss == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable set failed.\n"));
+ return 11;
+ };
+ //in case of adding new element to group we not set his value
+ //(value field of input are used to get variable name)
+ //We only output index of new added element
+ if(optflags.quiet == 0) {
+ printf(gettext("Added element index: %d\n"), config_setting_index(ss));
+ } else {
+ printf("%d", config_setting_index(ss));
+ };
+ break;
+ };
+ }
+
+ //Finaly write configuration file
+ scs = config_write_file(&cfg, configFile);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration file write failed.\n"));
+ return 8;
+ };
+ config_destroy(&cfg);
+ return 0;
+};
+
+//unset configuration path
+//(remove variable from configuration file)
+//@return int success
+//@param char* configFile - the name (with path) of configuration file
+//@param char* configPath - path to configuration valriable to remove (unset)
+//@param struct flags optflags - global flags
+int unset_config(char *configFile, char *dataPath, struct flags optflags) {
+ config_t cfg; //configuration file handler
+ config_setting_t *setting, *par; //configuration valriale handler, and paren variable handler
+ int idx, scs; //index of variable, sucess status
+ //open configuration file
+ config_init(&cfg);
+ if(!config_read_file(&cfg, configFile)) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n"));
+ return 1;
+ };
+ //chceck if data path given
+ if(dataPath == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Conviguration variable path not given.\n"));
+ return 4;
+ };
+ //now find variable of given path
+ setting = config_lookup(&cfg, dataPath);
+ if(setting == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Given variable path not found.\n"));
+ return 3;
+ };
+ //get element index
+ idx = config_setting_index(setting);
+ if(idx < 0) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Can't remove root element.\n"));
+ return 5;
+ };
+ //now find parent element
+ par = config_setting_parent(setting);
+ if(par == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Can't find parent element.\n"));
+ return 6;
+ };
+ //then remove element
+ scs = config_setting_remove_elem(par, idx);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Variable unset failed.\n"));
+ return 7;
+ };
+ //Finaly write configuration file
+ scs = config_write_file(&cfg, configFile);
+ if(scs == CONFIG_FALSE) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Configuration file write failed.\n"));
+ return 8;
+ };
+ config_destroy(&cfg);
+ return 0;
+};
+
+//get configuratioin variable
+//(read it from configuration file)
+//@return char* variable value
+//@param char* configFile - configuration file name (with path)
+//@param cher* dataPath - configuration variable path (in file)
+//@param struct flags optflags - global flags
+int read_config(char *configFile, char *dataPath, struct flags optflags) {
+ config_t cfg; //configuration file handler
+ config_setting_t *setting, *ss; //configuration element handler, and helper handler (config element too)
+ int comaset, varindex, varcounter; //helper flat for buid output strings, varibale index, counter
+ unsigned int maxel, i; //max elements, and loop index
+ char buffer[256]; //reading buffer
+ const char *cbuffer;
+ const char *coma=";"; //output string variable separator
+ int ibuffer, ssize; //value int buffer
+ char *dataName, *dataTypeName, *dataValueString; //name of variable, type of variable, value of variable
+ int dataType, st; //internale variable type
+ //initialize values
+ dataValueString = malloc(1);
+ dataTypeName = malloc(1);
+ memset(dataValueString, 0, 1);
+ memset(dataTypeName, 0, 1);
+ varindex = 0;
+ varcounter = 0;
+ //open and read configuration file
+ config_init(&cfg);
+ if(!config_read_file(&cfg, configFile)) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n"));
+ return 1;
+ };
+ //now find variable element of given path
+ if(dataPath == NULL) {
+ //if path not givne load root element (default)
+ setting = config_root_setting(&cfg);
+ } else {
+ setting = config_lookup(&cfg, dataPath);
+ };
+ if(setting == NULL) {
+ config_destroy(&cfg);
+ if(optflags.quiet == 0) printf(gettext("ERROR! Given variable path not found.\n"));
+ return 3;
+ };
+ //read variable name
+ dataName = config_setting_name(setting);
+ if(dataName == NULL) dataName = "NULL"; //in case variable have no name convert to string representation
+ //read variable type
+ dataType = config_setting_type(setting);
+ //next conver type to human readable and read variable value based on his type
+ //and in cases in type not scalar read index and coutn variables
+ switch(dataType) {
+ case CONFIG_TYPE_INT:
+ dataTypeName = (char*)realloc(dataTypeName, 4*sizeof(char));
+ strcpy(dataTypeName, "int");
+ sprintf(buffer, "%d", config_setting_get_int(setting));
+ dataValueString = (char*)realloc(dataValueString, (strlen(buffer)+1)*sizeof(char));
+ strcpy(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_INT64:
+ dataTypeName = (char*)realloc(dataTypeName, 6*sizeof(char));
+ strcpy(dataTypeName, "int64");
+ sprintf(buffer, "%lld", config_setting_get_int64(setting));
+ dataValueString = (char*)realloc(dataValueString, (strlen(buffer)+1)*sizeof(char));
+ strcpy(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_FLOAT:
+ dataTypeName = (char*)realloc(dataTypeName, 9*sizeof(char));
+ strcpy(dataTypeName, "float");
+ sprintf(buffer, "%f", config_setting_get_float(setting));
+ dataValueString = (char*)realloc(dataValueString, (strlen(buffer)+1)*sizeof(char));
+ strcpy(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_STRING:
+ dataTypeName = (char*)realloc(dataTypeName, 7*sizeof(char));
+ strcpy(dataTypeName, "string");
+ cbuffer = config_setting_get_string(setting);
+ dataValueString = (char*)realloc(dataValueString, (strlen(cbuffer)+1)*sizeof(char));
+ strcpy(dataValueString, cbuffer);
+ break;
+ case CONFIG_TYPE_BOOL:
+ dataTypeName = (char*)realloc(dataTypeName, 5*sizeof(char));
+ strcpy(dataTypeName, "bool");
+ if(optflags.boolstring == 1) {
+ //if expect bool as string, convert it to human readable
+ ibuffer = config_setting_get_bool(setting);
+ if(ibuffer == CONFIG_TRUE) {
+ dataValueString = (char*)realloc(dataValueString, 5*sizeof(char));
+ strcpy(dataValueString, "true");
+ } else {
+ dataValueString = (char*)realloc(dataValueString, 6*sizeof(char));
+ strcpy(dataValueString, "false");
+ }
+ } else {
+ //else output as digit
+ sprintf(buffer, "%d", config_setting_get_bool(setting));
+ dataValueString = (char*)realloc(dataValueString, (strlen(buffer)+1)*sizeof(char));
+ strcpy(dataValueString, buffer);
+ };
+ break;
+ case CONFIG_TYPE_ARRAY:
+ dataTypeName = (char*)realloc(dataTypeName, 6*sizeof(char));
+ strcpy(dataTypeName, "array");
+ //get element count
+ maxel = (unsigned int)config_setting_length(setting);
+ comaset = 0;
+ //and loop over all elements
+ for(i = 0; i < maxel; i++) {
+ //get element
+ ss = config_setting_get_elem(setting, i);
+ if(ss != NULL) {
+ st = config_setting_type(ss);
+ switch(st) {
+ case CONFIG_TYPE_INT:
+ sprintf(buffer, "%d", config_setting_get_int(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_INT64:
+ sprintf(buffer, "%lld", config_setting_get_int64(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_FLOAT:
+ sprintf(buffer, "%f", config_setting_get_float(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_STRING:
+ ssize = (int)strlen(config_setting_get_string(ss));
+
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+ssize+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, config_setting_get_string(ss));
+ break;
+ case CONFIG_TYPE_BOOL:
+ if(optflags.boolstring == 1) {
+ ibuffer = config_setting_get_bool(ss);
+ if(ibuffer == CONFIG_TRUE) {
+ //if bool must be outputed as humen readable - convert it
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+4+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "true");
+ } else {
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+5+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "false");
+ }
+ } else {
+ //else output as digit
+ sprintf(buffer, "%d", config_setting_get_bool(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ };
+ break;
+ case CONFIG_TYPE_ARRAY:
+ //if array contains array output as kwyword ARRAY
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+7)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "ARRAY");
+ break;
+ case CONFIG_TYPE_LIST:
+ //if array contains list output as keyword LIST
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+6)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "LIST");
+ break;
+ case CONFIG_TYPE_GROUP:
+ //if array contains group output as keywort GROUP
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+7)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "GROUP");
+ break;
+ };
+ comaset = 1;
+ };
+ };
+ break;
+ case CONFIG_TYPE_LIST:
+ dataTypeName = (char*)realloc(dataTypeName, 5*sizeof(char));
+ strcpy(dataTypeName, "list");
+ //get element count
+ maxel = (unsigned int)config_setting_length(setting);
+ //end loop over all elements
+ comaset = 0;
+ for(i = 0; i < maxel; i++) {
+ ss = config_setting_get_elem(setting, i);
+ if(ss != NULL) {
+ st = config_setting_type(ss);
+ switch(st) {
+ case CONFIG_TYPE_INT:
+ sprintf(buffer, "%d", config_setting_get_int(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_INT64:
+ sprintf(buffer, "%lld", config_setting_get_int64(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_FLOAT:
+ sprintf(buffer, "%f", config_setting_get_float(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ break;
+ case CONFIG_TYPE_STRING:
+ ssize = (int)strlen(config_setting_get_string(ss));
+
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+ssize+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, config_setting_get_string(ss));
+ break;
+ case CONFIG_TYPE_BOOL:
+ if(optflags.boolstring == 1) {
+ ibuffer = config_setting_get_bool(ss);
+ if(ibuffer == CONFIG_TRUE) {
+ //if bool must be printout as humanreadable - convert it
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+4+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "true");
+ } else {
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+5+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "false");
+ }
+ } else {
+ //else output as int
+ sprintf(buffer, "%d", config_setting_get_bool(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+strlen(buffer)+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, buffer);
+ };
+ break;
+ case CONFIG_TYPE_ARRAY:
+ //if list contain array output as keyword ARRAY
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+7)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "ARRAY");
+ break;
+ case CONFIG_TYPE_LIST:
+ //if list contain list output as keyword LIST
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+6)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "LIST");
+ break;
+ case CONFIG_TYPE_GROUP:
+ //if list contain group output as keyword GROUP
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+7)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, "GROUP");
+ break;
+ };
+ comaset = 1;
+ };
+ };
+ break;
+ case CONFIG_TYPE_GROUP:
+ dataTypeName = (char*)realloc(dataTypeName, 6*sizeof(char));
+ strcpy(dataTypeName, "group");
+ //get elementc count
+ maxel = (unsigned int)config_setting_length(setting);
+ //and loop over all elements
+ //but in group case, we return inside variables names
+ comaset = 0;
+ for(i = 0; i < maxel; i++) {
+ ss = config_setting_get_elem(setting, i);
+ if(ss != NULL) {
+ ssize = (int)strlen(config_setting_name(ss));
+ dataValueString = (char*)realloc(dataValueString, (strlen(dataValueString)+ssize+2)*sizeof(char));
+ if(comaset == 1) strcat(dataValueString, coma);
+ strcat(dataValueString, config_setting_name(ss));
+ comaset = 1;
+ };
+ };
+ break;
+ };
+
+ //last we get readed variable index, and element count
+ varindex = config_setting_index(setting);
+ varcounter = config_setting_length(setting);
+
+ //and finaly output data
+ if(optflags.names == 1 && optflags.quiet == 0) printf(gettext("Variable name: %s\n"), dataName);
+ if(optflags.names == 1 && optflags.quiet == 1) printf("%s", dataName);
+ if((optflags.types == 1 && optflags.quiet == 1) && optflags.names == 1) printf(":");
+ if(optflags.types == 1 && optflags.quiet == 0) printf(gettext("Variable type: %s\n"), dataTypeName);
+ if(optflags.types == 1 && optflags.quiet == 1) printf("%s", dataTypeName);
+ if((optflags.values == 1 && optflags.quiet == 1) && (optflags.names == 1 || optflags.types == 1)) printf(":");
+ if(optflags.values == 1 && optflags.quiet == 0) printf(gettext("Variable value: %s\n"), dataValueString);
+ if(optflags.values == 1 && optflags.quiet == 1) printf("%s", dataValueString);
+ if((optflags.indexes == 1 && optflags.quiet == 1) && (optflags.names == 1 || optflags.types == 1 || optflags.values == 1)) printf(":");
+ if(optflags.indexes == 1 && optflags.quiet == 0) printf(gettext("Variable index: %d\n"), varindex);
+ if(optflags.indexes == 1 && optflags.quiet == 1) printf("%d", varindex);
+ if((optflags.counter == 1 && optflags.quiet == 1) && (optflags.names == 1 || optflags.types == 1 || optflags.values == 1 || optflags.indexes == 1)) printf(":");
+ if(optflags.counter == 1 && optflags.quiet == 0) printf(gettext("Variable elements count: %d\n"), varcounter);
+ if(optflags.counter == 1 && optflags.quiet == 1) printf("%d", varcounter);
+ if(optflags.quiet == 1) printf("\n");
+
+ config_destroy(&cfg);
+ return 0;
+}
+
+int main(int argc, char **argv) {
+ //firs set locale and domain to work with internationalization
+ setlocale(LC_ALL, "");
+ bindtextdomain("ls-config", "/usr/share/locale");
+ textdomain("ls-config");
+
+ //then declare and init values
+ int opt,test; //used for read innput: option, and testing
+ int fd; //file descriptor
+ char *sinp, *dataPath=NULL, *dataString=NULL, *dataType=NULL; //string input, configuration variable path, input data, variable type
+ char *configFile=NULL; //config file name (with path)
+ struct flags optflags = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; //global flags initialize
+ int excode; //program exit code
+ excode = 0;
+
+ sinp = malloc(sizeof(char) * 256);
+
+ //long options reading
+ struct option long_options[] = {
+ /* These options set a flag. */
+ {"quiet", no_argument, &optflags.quiet, 1},
+ {"names", no_argument, &optflags.names, 1},
+ {"types", no_argument, &optflags.types, 1},
+ {"values", no_argument, &optflags.values, 1},
+ {"indexes", no_argument, &optflags.indexes, 1},
+ {"count", no_argument, &optflags.counter, 1},
+ {"unset", no_argument, &optflags.unset, 1},
+ {"bool-string", no_argument, &optflags.boolstring, 1},
+ /* These options don't set a flag.
+ We distinguish them by their indices. */
+ {"help", no_argument, 0, 'h'},
+ {"set", required_argument, 0, 's'},
+ {"get", optional_argument, 0, 'g'},
+ {"data", required_argument, 0, 'd'},
+ {"type", required_argument, 0, 'p'},
+ {"file", required_argument, 0, 'f'},
+ {0, 0, 0, 0}
+ };
+
+ //next collect all input (given as options to program)
+ while(1) {
+ int option_index = 0;
+ opt = getopt_long (argc, argv, "qntvicubs:g:d:p:hf:", long_options, &option_index);
+
+ if(opt == -1) break;
+
+ switch (opt) {
+ case 0:
+ /* If this option set a flag, do nothing else now. */
+ if(long_options[option_index].flag != 0) break;
+ if(strcmp(long_options[option_index].name, "set") == 0 && optarg) {
+ test = sscanf(optarg, "%s", sinp);
+ if(test > 0) {
+ dataPath = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataPath, sinp);
+ };
+ optflags.mode = 1;
+ };
+ if(strcmp(long_options[option_index].name, "get") == 0 && optarg) {
+ test = sscanf(optarg, "%s", sinp);
+ if(test > 0) {
+ dataPath = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataPath, sinp);
+ };
+ optflags.mode = 0;
+ };
+ if(strcmp(long_options[option_index].name, "data") == 0 && optarg) {
+ test = sscanf(optarg, "%[^\n]s", sinp);
+ if(test > 0) {
+ dataString = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataString, sinp);
+ };
+ };
+ if(strcmp(long_options[option_index].name, "type") == 0 && optarg) {
+ test = sscanf(optarg, "%s", sinp);
+ if(test > 0) {
+ dataType = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataType, sinp);
+ };
+ };
+ if(strcmp(long_options[option_index].name, "file") == 0 && optarg) {
+ test = sscanf(optarg, "%[^\n]s", sinp);
+ if(test > 0) {
+ configFile = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(configFile, sinp);
+ };
+ };
+ break;
+ case 'q':
+ optflags.quiet = 1;
+ break;
+ case 'n':
+ optflags.names = 1;
+ break;
+ case 't':
+ optflags.types = 1;
+ break;
+ case 'v':
+ optflags.values = 1;
+ break;
+ case 'i':
+ optflags.indexes = 1;
+ break;
+ case 'c':
+ optflags.counter = 1;
+ break;
+ case 'u':
+ optflags.unset = 1;
+ break;
+ case 'b':
+ optflags.boolstring = 1;
+ break;
+ case 's':
+ if(optarg) {
+ test = sscanf(optarg, "%s", sinp);
+ if(test > 0) {
+ dataPath = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataPath, sinp);
+ };
+ optflags.mode = 1;
+ };
+ break;
+ case 'g':
+ if(optarg) {
+ test = sscanf(optarg, "%s", sinp);
+ if(test > 0) {
+ dataPath = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataPath, sinp);
+ };
+ };
+ optflags.mode = 0;
+ break;
+ case 'd':
+ if(optarg) {
+ test = sscanf(optarg, "%[^\n]s", sinp);
+ if(test > 0) {
+ dataString = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataString, sinp);
+ };
+ };
+ break;
+ case 'p':
+ if(optarg) {
+ test = sscanf(optarg, "%s", sinp);
+ if(test > 0) {
+ dataType = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(dataType, sinp);
+ };
+ };
+ break;
+ case 'h':
+ //free input buffer and printout help message
+ free(sinp);
+ printHelp(); //this function contain exit from program
+ break;
+ case 'f':
+ test = sscanf(optarg, "%[^\n]s", sinp);
+ if(test > 0) {
+ configFile = (char*)malloc((strlen(sinp)+1)*sizeof(char));
+ strcpy(configFile, sinp);
+ };
+ break;
+ case '?':
+ break;
+ default:
+ break;
+ }
+ };
+
+ //first of all we must ensure, then configuration file are available with right access mode
+ if(optflags.mode == 0 && access(configFile, R_OK) < 0) optflags.error = 1;
+ if(optflags.mode == 1) {
+ fd = open(configFile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+ if(fd < 0) {
+ optflags.error = 1;
+ };
+ close(fd);
+ };
+ if(optflags.error > 0) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Can't read configuration file.\n"));
+ free(sinp);
+ free(configFile);
+ exit(1);
+ };
+
+ //now if we want to set variable, we must have his path
+ if(optflags.mode == 1 && dataPath == NULL) {
+ if(optflags.quiet == 0) printf(gettext("ERROR! Conviguration variable path not given.\n"));
+ free(sinp);
+ free(configFile);
+ exit(4);
+ };
+
+ //if no output data requested, set to default output
+ if(optflags.names == 0 && optflags.types == 0 && optflags.values == 0 && optflags.indexes == 0 && optflags.counter == 0) {
+ optflags.names = 1;
+ optflags.types = 1;
+ optflags.values = 1;
+ };
+
+ //now we invode main work of this software based on request type (set, unset of get)
+ if(optflags.mode == 0) excode = read_config(configFile, dataPath, optflags);
+ if(optflags.mode == 1 && optflags.unset == 1) excode = unset_config(configFile, dataPath, optflags);
+ if(optflags.mode == 1 && optflags.unset == 0) excode = set_config(configFile, dataPath, optflags, dataString, dataType);
+
+ //then finalize free resources and exit returnig excode
+ free(sinp);
+ free(configFile);
+ exit(excode);
+}
+
diff --git a/contrib/ls-config/src/makefile b/contrib/ls-config/src/makefile
new file mode 100644
index 0000000..d04a773
--- /dev/null
+++ b/contrib/ls-config/src/makefile
@@ -0,0 +1,34 @@
+CC=gcc
+CFLAGS=-O2 -Wall
+#Use for DEVELOP mode:
+#DEVFLAGS=-g -D __DEVEL__
+#Use for PRODUCTION mode:
+DEVFLAGS=-s -fomit-frame-pointer
+
+all: ls-config langs
+
+ls-config: ls-config.c ls-config.pot
+ $(CC) $(CFLAGS) $(DEVFLAGS) -o ../ls-config ls-config.c -L../lib -lm -lconfig
+
+ls-config.pot:
+ xgettext -d ls-config -o po/ls-config.pot ls-config.c
+
+langs:
+ make -C po
+
+install:
+ mkdir -p /usr/share/ls/lib
+ chown root:adm /usr/share/ls/lib
+ cp ../ls-config /usr/share/ls/lib/
+ chown root:adm /usr/share/ls/lib
+ chmod 755 /usr/share/ls/lib/ls-config
+ make -C po install
+
+clean:
+ make -C po clean
+
+remove:
+ rm -f /usr/share/ls/lib/ls-config
+ make -C po remove
+
+
diff --git a/contrib/ls-config/src/po/en_GB.po b/contrib/ls-config/src/po/en_GB.po
new file mode 100644
index 0000000..d16bfdf
--- /dev/null
+++ b/contrib/ls-config/src/po/en_GB.po
@@ -0,0 +1,289 @@
+# Language en-GB translations for PACKAGE package.
+# Copyright (C) 2013 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Łukasz A. Grabowski <lucas@lucas.net.pl>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-06 19:23+0200\n"
+"PO-Revision-Date: 2013-09-09 23:56+0200\n"
+"Last-Translator: Łukasz A. Grabowski <lucas@lucas.net.pl>\n"
+"Language-Team: Language en-GB\n"
+"Language: en-GB\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ls-config.c:49
+#, c-format
+msgid "Configuration file handling\n"
+msgstr "Configuration file handling\n"
+
+#: ls-config.c:51
+#, c-format
+msgid "Usage: ls-config [OPTION]\n"
+msgstr "Usage: ls-config [OPTION]\n"
+
+#: ls-config.c:52
+#, c-format
+msgid "Reading and writening data from configuration files\n"
+msgstr "Reading and writening data from configuration files\n"
+
+#: ls-config.c:53
+#, c-format
+msgid "in libconfig9 format.\n"
+msgstr "in libconfig9 format.\n"
+
+#: ls-config.c:55
+#, c-format
+msgid "CAUTION: using without given config file are cause error!\n"
+msgstr "CAUTION: using without given config file are cause error!\n"
+
+#: ls-config.c:57
+#, c-format
+msgid "Available options:\n"
+msgstr "Available options:\n"
+
+#: ls-config.c:58
+#, c-format
+msgid " -f, --file=FILE Configuration file to handle.\n"
+msgstr " -f, --file=FILE Configuration file to handle.\n"
+
+#: ls-config.c:60
+#, c-format
+msgid " -s, --set=PATH Set configuration variable of given path.\n"
+msgstr " -s, --set=PATH Set configuration variable of given path.\n"
+
+#: ls-config.c:61
+#, c-format
+msgid " -d, --data=DATA Configuration variable value (only with -s)\n"
+msgstr " -d, --data=DATA Configuration variable value (only with -s)\n"
+
+#: ls-config.c:62
+#, c-format
+msgid " -p, --type=TYPE Configuration value type\n"
+msgstr " -p, --type=TYPE Configuration value type\n"
+
+#: ls-config.c:64
+#, c-format
+msgid " -g, --get=PATH Get configuration variable of given path.\n"
+msgstr " -g, --get=PATH Get configuration variable of given path.\n"
+
+#: ls-config.c:65
+#, c-format
+msgid " -n, --names Printout variables names.\n"
+msgstr " -n, --names Printout variables names.\n"
+
+#: ls-config.c:66
+#, c-format
+msgid " -t, --types Printout variables types.\n"
+msgstr " -t, --types Printout variables types.\n"
+
+#: ls-config.c:67
+#, c-format
+msgid " -v, --values Printout variables values.\n"
+msgstr " -v, --values Printout variables values.\n"
+
+#: ls-config.c:68
+#, c-format
+msgid " -i, --indexes Printout variables indexes.\n"
+msgstr " -i, --indexes Printout variables indexes.\n"
+
+#: ls-config.c:69
+#, c-format
+msgid ""
+" -c, --count Printout elements count (only: array, list, "
+"group).\n"
+msgstr ""
+" -c, --count Printout elements count (only: array, list, "
+"group).\n"
+
+#: ls-config.c:70
+#, c-format
+msgid " -b, --bool-string Printout boolean variables as text.\n"
+msgstr " -b, --bool-string Printout boolean variables as text.\n"
+
+#: ls-config.c:72
+#, c-format
+msgid " -q, --quiet Quiet output to use in scripts.\n"
+msgstr " -q, --quiet Quiet output to use in scripts.\n"
+
+#: ls-config.c:73
+#, c-format
+msgid " -h, --help Print this help message.\n"
+msgstr " -h, --help Print this help message.\n"
+
+#: ls-config.c:75
+#, c-format
+msgid "TYPE: Variable types:\n"
+msgstr "TYPE: Variable types:\n"
+
+#: ls-config.c:76
+#, c-format
+msgid " group - variables group,\n"
+msgstr " group - variables group,\n"
+
+#: ls-config.c:77
+#, c-format
+msgid " array - array of variables,\n"
+msgstr " array - array of variables (same scalar type),\n"
+
+#: ls-config.c:78
+#, c-format
+msgid " list - list of variables,\n"
+msgstr " list - list of variables,\n"
+
+#: ls-config.c:79
+#, c-format
+msgid " int - integer number,\n"
+msgstr " int - integer number,\n"
+
+#: ls-config.c:80
+#, c-format
+msgid " int64 - 64bit integer number,\n"
+msgstr " int64 - 64bit integer number,\n"
+
+#: ls-config.c:81
+#, c-format
+msgid " float - float point number,\n"
+msgstr " float - float point number,\n"
+
+#: ls-config.c:82
+#, c-format
+msgid " bool - boolean value,\n"
+msgstr " bool - boolean value,\n"
+
+#: ls-config.c:83
+#, c-format
+msgid " string - character string.\n"
+msgstr " string - character string.\n"
+
+#: ls-config.c:87
+#, c-format
+msgid "Licence: "
+msgstr "Licence: "
+
+#: ls-config.c:102 ls-config.c:126 ls-config.c:149 ls-config.c:172
+#, c-format
+msgid "ERROR! Incorrect data format.\n"
+msgstr "ERROR! Incorrect data format.\n"
+
+#: ls-config.c:110 ls-config.c:133 ls-config.c:156 ls-config.c:179
+#: ls-config.c:346 ls-config.c:364 ls-config.c:431 ls-config.c:477
+#: ls-config.c:507 ls-config.c:535 ls-config.c:555 ls-config.c:575
+#: ls-config.c:595 ls-config.c:602 ls-config.c:616 ls-config.c:662
+#: ls-config.c:681 ls-config.c:739
+#, c-format
+msgid "ERROR! Variable set failed.\n"
+msgstr "ERROR! Variable set failed.\n"
+
+#: ls-config.c:272 ls-config.c:779 ls-config.c:855 ls-config.c:1314
+#, c-format
+msgid "ERROR! Can't read configuration file.\n"
+msgstr "ERROR! Can't read configuration file.\n"
+
+#: ls-config.c:279 ls-config.c:785 ls-config.c:1322
+#, c-format
+msgid "ERROR! Conviguration variable path not given.\n"
+msgstr "ERROR! Conviguration variable path not given.\n"
+
+#: ls-config.c:284
+#, c-format
+msgid "ERROR! Configuration variable value not given.\n"
+msgstr "ERROR! Configuration variable value not given.\n"
+
+#: ls-config.c:303
+#, c-format
+msgid "ERROR! Inavlid configuration variable path.\n"
+msgstr "ERROR! Inavlid configuration variable path.\n"
+
+#: ls-config.c:310
+#, c-format
+msgid ""
+"ERROR! New named configuration variable can be added only to group element.\n"
+msgstr ""
+"ERROR! New named configuration variable can be added only to group element.\n"
+
+#: ls-config.c:316 ls-config.c:454 ls-config.c:634 ls-config.c:705
+#, c-format
+msgid "ERROR! Configuration variable type not given.\n"
+msgstr "ERROR! Configuration variable type not given.\n"
+
+#: ls-config.c:339 ls-config.c:655 ls-config.c:732
+#, c-format
+msgid "ERROR! Inlegal data type.\n"
+msgstr "ERROR! Inlegal data type.\n"
+
+#: ls-config.c:385 ls-config.c:398 ls-config.c:411 ls-config.c:424
+#: ls-config.c:438 ls-config.c:528 ls-config.c:548 ls-config.c:568
+#: ls-config.c:588 ls-config.c:609
+#, c-format
+msgid "ERROR! inconsistent value type.\n"
+msgstr "ERROR! inconsistent value type.\n"
+
+#: ls-config.c:470
+#, c-format
+msgid "ERROR! Prohibited data type.\n"
+msgstr "ERROR! Prohibited data type.\n"
+
+#: ls-config.c:696 ls-config.c:746
+#, c-format
+msgid "Added element index: %d\n"
+msgstr "Added element index: %d\n"
+
+#: ls-config.c:710
+#, c-format
+msgid "ERROR! Bad name of configuration variable.\n"
+msgstr "ERROR! Bad name of configuration variable.\n"
+
+#: ls-config.c:758 ls-config.c:820
+#, c-format
+msgid "ERROR! Configuration file write failed.\n"
+msgstr "ERROR! Configuration file write failed.\n"
+
+#: ls-config.c:792 ls-config.c:867
+#, c-format
+msgid "ERROR! Given variable path not found.\n"
+msgstr "ERROR! Given variable path not found.\n"
+
+#: ls-config.c:799
+#, c-format
+msgid "ERROR! Can't remove root element.\n"
+msgstr "ERROR! Can't remove root element.\n"
+
+#: ls-config.c:806
+#, c-format
+msgid "ERROR! Can't find parent element.\n"
+msgstr "ERROR! Can't find parent element.\n"
+
+#: ls-config.c:813
+#, c-format
+msgid "ERROR! Variable unset failed.\n"
+msgstr "ERROR! Variable unset failed.\n"
+
+#: ls-config.c:1115
+#, c-format
+msgid "Variable name: %s\n"
+msgstr "Variable name: %s\n"
+
+#: ls-config.c:1118
+#, c-format
+msgid "Variable type: %s\n"
+msgstr "Variable type: %s\n"
+
+#: ls-config.c:1121
+#, c-format
+msgid "Variable value: %s\n"
+msgstr "Variable value: %s\n"
+
+#: ls-config.c:1124
+#, c-format
+msgid "Variable index: %d\n"
+msgstr "Variable index: %d\n"
+
+#: ls-config.c:1127
+#, c-format
+msgid "Variable elements count: %d\n"
+msgstr "Variable elements count: %d\n"
diff --git a/contrib/ls-config/src/po/ls-config.pot b/contrib/ls-config/src/po/ls-config.pot
new file mode 100644
index 0000000..d6800e2
--- /dev/null
+++ b/contrib/ls-config/src/po/ls-config.pot
@@ -0,0 +1,287 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-11 22:00+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ls-config.c:49
+#, c-format
+msgid "Configuration file handling\n"
+msgstr ""
+
+#: ls-config.c:51
+#, c-format
+msgid "Usage: ls-config [OPTION]\n"
+msgstr ""
+
+#: ls-config.c:52
+#, c-format
+msgid "Reading and writening data from configuration files\n"
+msgstr ""
+
+#: ls-config.c:53
+#, c-format
+msgid "in libconfig9 format.\n"
+msgstr ""
+
+#: ls-config.c:55
+#, c-format
+msgid "CAUTION: using without given config file are cause error!\n"
+msgstr ""
+
+#: ls-config.c:57
+#, c-format
+msgid "Available options:\n"
+msgstr ""
+
+#: ls-config.c:58
+#, c-format
+msgid " -f, --file=FILE Configuration file to handle.\n"
+msgstr ""
+
+#: ls-config.c:60
+#, c-format
+msgid " -s, --set=PATH Set configuration variable of given path.\n"
+msgstr ""
+
+#: ls-config.c:61
+#, c-format
+msgid " -d, --data=DATA Configuration variable value (only with -s)\n"
+msgstr ""
+
+#: ls-config.c:62
+#, c-format
+msgid " -p, --type=TYPE Configuration value type\n"
+msgstr ""
+
+#: ls-config.c:64
+#, c-format
+msgid " -g, --get=PATH Get configuration variable of given path.\n"
+msgstr ""
+
+#: ls-config.c:65
+#, c-format
+msgid " -n, --names Printout variables names.\n"
+msgstr ""
+
+#: ls-config.c:66
+#, c-format
+msgid " -t, --types Printout variables types.\n"
+msgstr ""
+
+#: ls-config.c:67
+#, c-format
+msgid " -v, --values Printout variables values.\n"
+msgstr ""
+
+#: ls-config.c:68
+#, c-format
+msgid " -i, --indexes Printout variables indexes.\n"
+msgstr ""
+
+#: ls-config.c:69
+#, c-format
+msgid ""
+" -c, --count Printout elements count (only: array, list, "
+"group).\n"
+msgstr ""
+
+#: ls-config.c:70
+#, c-format
+msgid " -b, --bool-string Printout boolean variables as text.\n"
+msgstr ""
+
+#: ls-config.c:72
+#, c-format
+msgid " -q, --quiet Quiet output to use in scripts.\n"
+msgstr ""
+
+#: ls-config.c:73
+#, c-format
+msgid " -h, --help Print this help message.\n"
+msgstr ""
+
+#: ls-config.c:75
+#, c-format
+msgid "TYPE: Variable types:\n"
+msgstr ""
+
+#: ls-config.c:76
+#, c-format
+msgid " group - variables group,\n"
+msgstr ""
+
+#: ls-config.c:77
+#, c-format
+msgid " array - array of variables,\n"
+msgstr ""
+
+#: ls-config.c:78
+#, c-format
+msgid " list - list of variables,\n"
+msgstr ""
+
+#: ls-config.c:79
+#, c-format
+msgid " int - integer number,\n"
+msgstr ""
+
+#: ls-config.c:80
+#, c-format
+msgid " int64 - 64bit integer number,\n"
+msgstr ""
+
+#: ls-config.c:81
+#, c-format
+msgid " float - float point number,\n"
+msgstr ""
+
+#: ls-config.c:82
+#, c-format
+msgid " bool - boolean value,\n"
+msgstr ""
+
+#: ls-config.c:83
+#, c-format
+msgid " string - character string.\n"
+msgstr ""
+
+#: ls-config.c:87
+#, c-format
+msgid "Licence: "
+msgstr ""
+
+#: ls-config.c:102 ls-config.c:126 ls-config.c:149 ls-config.c:172
+#, c-format
+msgid "ERROR! Incorrect data format.\n"
+msgstr ""
+
+#: ls-config.c:110 ls-config.c:133 ls-config.c:156 ls-config.c:179
+#: ls-config.c:346 ls-config.c:364 ls-config.c:431 ls-config.c:477
+#: ls-config.c:507 ls-config.c:535 ls-config.c:555 ls-config.c:575
+#: ls-config.c:595 ls-config.c:602 ls-config.c:616 ls-config.c:662
+#: ls-config.c:681 ls-config.c:739
+#, c-format
+msgid "ERROR! Variable set failed.\n"
+msgstr ""
+
+#: ls-config.c:272 ls-config.c:779 ls-config.c:855 ls-config.c:1314
+#, c-format
+msgid "ERROR! Can't read configuration file.\n"
+msgstr ""
+
+#: ls-config.c:279 ls-config.c:785 ls-config.c:1322
+#, c-format
+msgid "ERROR! Conviguration variable path not given.\n"
+msgstr ""
+
+#: ls-config.c:284
+#, c-format
+msgid "ERROR! Configuration variable value not given.\n"
+msgstr ""
+
+#: ls-config.c:303
+#, c-format
+msgid "ERROR! Inavlid configuration variable path.\n"
+msgstr ""
+
+#: ls-config.c:310
+#, c-format
+msgid ""
+"ERROR! New named configuration variable can be added only to group element.\n"
+msgstr ""
+
+#: ls-config.c:316 ls-config.c:454 ls-config.c:634 ls-config.c:705
+#, c-format
+msgid "ERROR! Configuration variable type not given.\n"
+msgstr ""
+
+#: ls-config.c:339 ls-config.c:655 ls-config.c:732
+#, c-format
+msgid "ERROR! Inlegal data type.\n"
+msgstr ""
+
+#: ls-config.c:385 ls-config.c:398 ls-config.c:411 ls-config.c:424
+#: ls-config.c:438 ls-config.c:528 ls-config.c:548 ls-config.c:568
+#: ls-config.c:588 ls-config.c:609
+#, c-format
+msgid "ERROR! inconsistent value type.\n"
+msgstr ""
+
+#: ls-config.c:470
+#, c-format
+msgid "ERROR! Prohibited data type.\n"
+msgstr ""
+
+#: ls-config.c:696 ls-config.c:746
+#, c-format
+msgid "Added element index: %d\n"
+msgstr ""
+
+#: ls-config.c:710
+#, c-format
+msgid "ERROR! Bad name of configuration variable.\n"
+msgstr ""
+
+#: ls-config.c:758 ls-config.c:820
+#, c-format
+msgid "ERROR! Configuration file write failed.\n"
+msgstr ""
+
+#: ls-config.c:792 ls-config.c:867
+#, c-format
+msgid "ERROR! Given variable path not found.\n"
+msgstr ""
+
+#: ls-config.c:799
+#, c-format
+msgid "ERROR! Can't remove root element.\n"
+msgstr ""
+
+#: ls-config.c:806
+#, c-format
+msgid "ERROR! Can't find parent element.\n"
+msgstr ""
+
+#: ls-config.c:813
+#, c-format
+msgid "ERROR! Variable unset failed.\n"
+msgstr ""
+
+#: ls-config.c:1115
+#, c-format
+msgid "Variable name: %s\n"
+msgstr ""
+
+#: ls-config.c:1118
+#, c-format
+msgid "Variable type: %s\n"
+msgstr ""
+
+#: ls-config.c:1121
+#, c-format
+msgid "Variable value: %s\n"
+msgstr ""
+
+#: ls-config.c:1124
+#, c-format
+msgid "Variable index: %d\n"
+msgstr ""
+
+#: ls-config.c:1127
+#, c-format
+msgid "Variable elements count: %d\n"
+msgstr ""
diff --git a/contrib/ls-config/src/po/makefile b/contrib/ls-config/src/po/makefile
new file mode 100644
index 0000000..0e05bc3
--- /dev/null
+++ b/contrib/ls-config/src/po/makefile
@@ -0,0 +1,34 @@
+DIRS:=$(shell find . -mindepth 1 -maxdepth 1 -name "*.po" -type f | sed -e 's/\(.*\)\..*/\1/')
+PACKAGES = $(DIRS:%=%.lang)
+IPACKAGES = $(DIRS:%=%.inst)
+CPACKAGES = $(DIRS:%=%.cln)
+RPACKAGES = $(DIRS:%=%.remov)
+SHELL := /bin/bash
+
+all: packages
+
+packages: $(PACKAGES)
+
+%.lang: %.po
+ msgmerge -U $< ls-config.pot
+ mkdir -p ../locale/$*/LC_MESSAGES
+ msgfmt -c -v -o ../locale/$*/LC_MESSAGES/ls-config.mo $<
+
+install: $(IPACKAGES)
+
+%.inst:
+ mkdir -p /usr/share/locale/$*/LC_MESSAGES
+ cp -f ../locale/$*/LC_MESSAGES/ls-config.mo /usr/share/locale/$*/LC_MESSAGES
+
+remove: $(RPACKAGES)
+
+%.remov:
+ rm -f /usr/share/locale/$*/LC_MESSAGES/ls-config.mo
+
+clean: $(CPACKAGES) cleandir
+
+%.cln:
+ rm -Rf ../locale/$*
+
+cleandir:
+ rm -Rf ../locale \ No newline at end of file
diff --git a/contrib/ls-config/src/po/pl_PL.po b/contrib/ls-config/src/po/pl_PL.po
new file mode 100644
index 0000000..56d518d
--- /dev/null
+++ b/contrib/ls-config/src/po/pl_PL.po
@@ -0,0 +1,292 @@
+# Language pl-PL translations for PACKAGE package.
+# Copyright (C) 2013 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Łukasz A. Grabowski <lucas@lucas.net.pl>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-06 19:23+0200\n"
+"PO-Revision-Date: 2013-09-09 23:55+0200\n"
+"Last-Translator: Łukasz A. Grabowski <lucas@lucas.net.pl>\n"
+"Language-Team: Language pl-PL\n"
+"Language: pl-PL\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ls-config.c:49
+#, c-format
+msgid "Configuration file handling\n"
+msgstr "Obsluga plików konfiguracyjnych\n"
+
+#: ls-config.c:51
+#, c-format
+msgid "Usage: ls-config [OPTION]\n"
+msgstr "Składnia: ls-config [OPCJA]\n"
+
+#: ls-config.c:52
+#, c-format
+msgid "Reading and writening data from configuration files\n"
+msgstr "Odczytuje i zapisuje pliki konfiguracyjne\n"
+
+#: ls-config.c:53
+#, c-format
+msgid "in libconfig9 format.\n"
+msgstr "w formacie libconfig9.\n"
+
+#: ls-config.c:55
+#, c-format
+msgid "CAUTION: using without given config file are cause error!\n"
+msgstr "UWAGA: użycie bez podania pliku konfiguracyjnego powoduje błąd!\n"
+
+#: ls-config.c:57
+#, c-format
+msgid "Available options:\n"
+msgstr "Dostępne opcje:\n"
+
+#: ls-config.c:58
+#, c-format
+msgid " -f, --file=FILE Configuration file to handle.\n"
+msgstr " -f, --file=PLIK Plik konfiguracyjny do obsłużenia.\n"
+
+#: ls-config.c:60
+#, c-format
+msgid " -s, --set=PATH Set configuration variable of given path.\n"
+msgstr ""
+" -s, --set=SCIEZKA Ustawia zmienną konfiguracyjną o podanej ścieżce.\n"
+
+#: ls-config.c:61
+#, c-format
+msgid " -d, --data=DATA Configuration variable value (only with -s)\n"
+msgstr ""
+" -d, --data=DANE Wartość zmiennej konfiguracyjnej (tylko z -s).\n"
+
+#: ls-config.c:62
+#, c-format
+msgid " -p, --type=TYPE Configuration value type\n"
+msgstr " -p, --type=TYP Typ wartości konfiguracyjnej.\n"
+
+#: ls-config.c:64
+#, c-format
+msgid " -g, --get=PATH Get configuration variable of given path.\n"
+msgstr ""
+" -g, --get=SCIEZKA Pobież zmienną konfiguracyjną o podajen ścieżce.\n"
+
+#: ls-config.c:65
+#, c-format
+msgid " -n, --names Printout variables names.\n"
+msgstr " -n, --names Wypisz nazwy zmiennych.\n"
+
+#: ls-config.c:66
+#, c-format
+msgid " -t, --types Printout variables types.\n"
+msgstr " -t, --types Wypisz typy zmiennych.\n"
+
+#: ls-config.c:67
+#, c-format
+msgid " -v, --values Printout variables values.\n"
+msgstr " -v, --values Wypisz wartości zmiennych.\n"
+
+#: ls-config.c:68
+#, c-format
+msgid " -i, --indexes Printout variables indexes.\n"
+msgstr " -i, --indexes Wypisz indexy zmiennych.\n"
+
+#: ls-config.c:69
+#, c-format
+msgid ""
+" -c, --count Printout elements count (only: array, list, "
+"group).\n"
+msgstr ""
+" -c, --count Wypisz liczy elementów (tylko: array, list, "
+"group).\n"
+
+#: ls-config.c:70
+#, c-format
+msgid " -b, --bool-string Printout boolean variables as text.\n"
+msgstr " -b, --bool-string Wypisz wartości logiczne tekstowo.\n"
+
+#: ls-config.c:72
+#, c-format
+msgid " -q, --quiet Quiet output to use in scripts.\n"
+msgstr " -q, --quiet Ciche wyjście do użcia w skryptach.\n"
+
+#: ls-config.c:73
+#, c-format
+msgid " -h, --help Print this help message.\n"
+msgstr " -h, --help Wyswietla niniejszy opis\n"
+
+#: ls-config.c:75
+#, c-format
+msgid "TYPE: Variable types:\n"
+msgstr "TYP: Typy zmiennej:\n"
+
+#: ls-config.c:76
+#, c-format
+msgid " group - variables group,\n"
+msgstr " group - grupa zmiennych.\n"
+
+#: ls-config.c:77
+#, c-format
+msgid " array - array of variables,\n"
+msgstr " array - tablica zmiennych (tego samego typu podstawowego),\n"
+
+#: ls-config.c:78
+#, c-format
+msgid " list - list of variables,\n"
+msgstr " list - lista zmiennych,\n"
+
+#: ls-config.c:79
+#, c-format
+msgid " int - integer number,\n"
+msgstr " int - liczba całkowita,\n"
+
+#: ls-config.c:80
+#, c-format
+msgid " int64 - 64bit integer number,\n"
+msgstr " int64 - liczba całkowita 64bitowa,\n"
+
+#: ls-config.c:81
+#, c-format
+msgid " float - float point number,\n"
+msgstr " float - liczba zmiennoprzecinkowa,\n"
+
+#: ls-config.c:82
+#, c-format
+msgid " bool - boolean value,\n"
+msgstr " bool - wartość logiczna,\n"
+
+#: ls-config.c:83
+#, c-format
+msgid " string - character string.\n"
+msgstr " string - łąńcuch znakowy.\n"
+
+#: ls-config.c:87
+#, c-format
+msgid "Licence: "
+msgstr "Licencja: "
+
+#: ls-config.c:102 ls-config.c:126 ls-config.c:149 ls-config.c:172
+#, c-format
+msgid "ERROR! Incorrect data format.\n"
+msgstr "BŁĄD! Błędny format danych.\n"
+
+#: ls-config.c:110 ls-config.c:133 ls-config.c:156 ls-config.c:179
+#: ls-config.c:346 ls-config.c:364 ls-config.c:431 ls-config.c:477
+#: ls-config.c:507 ls-config.c:535 ls-config.c:555 ls-config.c:575
+#: ls-config.c:595 ls-config.c:602 ls-config.c:616 ls-config.c:662
+#: ls-config.c:681 ls-config.c:739
+#, c-format
+msgid "ERROR! Variable set failed.\n"
+msgstr "BŁĄD! Nie udało sią ustawić zmiennej.\n"
+
+#: ls-config.c:272 ls-config.c:779 ls-config.c:855 ls-config.c:1314
+#, c-format
+msgid "ERROR! Can't read configuration file.\n"
+msgstr "BŁĄD! Nie można odczytać pliku konfiguracyjnego.\n"
+
+#: ls-config.c:279 ls-config.c:785 ls-config.c:1322
+#, c-format
+msgid "ERROR! Conviguration variable path not given.\n"
+msgstr "BŁĄD! Nie podano ścieżki zmiennej konfiguracyjnej.\n"
+
+#: ls-config.c:284
+#, c-format
+msgid "ERROR! Configuration variable value not given.\n"
+msgstr "BŁĄD! Nie podano wartości zmiennej konfiguracyjnej.\n"
+
+#: ls-config.c:303
+#, c-format
+msgid "ERROR! Inavlid configuration variable path.\n"
+msgstr "BŁĄD! Błędna ścieżka zmiennej konfiguracyjnej.\n"
+
+#: ls-config.c:310
+#, c-format
+msgid ""
+"ERROR! New named configuration variable can be added only to group element.\n"
+msgstr ""
+"BŁĄD! Nowa nazwana zmienna konfiguracyjne może być dodana tylko do grupy.\n"
+
+#: ls-config.c:316 ls-config.c:454 ls-config.c:634 ls-config.c:705
+#, c-format
+msgid "ERROR! Configuration variable type not given.\n"
+msgstr "BŁĄD! Nie podano typu zmiennej konfiguracyjnej.\n"
+
+#: ls-config.c:339 ls-config.c:655 ls-config.c:732
+#, c-format
+msgid "ERROR! Inlegal data type.\n"
+msgstr "BŁĄD! Niepoprawny typ zmiennej.\n"
+
+#: ls-config.c:385 ls-config.c:398 ls-config.c:411 ls-config.c:424
+#: ls-config.c:438 ls-config.c:528 ls-config.c:548 ls-config.c:568
+#: ls-config.c:588 ls-config.c:609
+#, c-format
+msgid "ERROR! inconsistent value type.\n"
+msgstr "BŁĄD! niezgodny typ vartości.\n"
+
+#: ls-config.c:470
+#, c-format
+msgid "ERROR! Prohibited data type.\n"
+msgstr "BŁĄD! Zabronionny typ danych.\n"
+
+#: ls-config.c:696 ls-config.c:746
+#, c-format
+msgid "Added element index: %d\n"
+msgstr "Indeks dodanego elementu: %d\n"
+
+#: ls-config.c:710
+#, c-format
+msgid "ERROR! Bad name of configuration variable.\n"
+msgstr "BŁĄD! Błędna nazwa zmiennej konfiguracyjnej.\n"
+
+#: ls-config.c:758 ls-config.c:820
+#, c-format
+msgid "ERROR! Configuration file write failed.\n"
+msgstr "BŁĄD! Nie udało się zapisać pliku konfiguracyjnego.\n"
+
+#: ls-config.c:792 ls-config.c:867
+#, c-format
+msgid "ERROR! Given variable path not found.\n"
+msgstr "BŁĄD! Nie odnaleziono zmiennej konfiguracyjnej o podanej ścieżce.\n"
+
+#: ls-config.c:799
+#, c-format
+msgid "ERROR! Can't remove root element.\n"
+msgstr "BŁĄD! Nie można usunąć głównego elementu.\n"
+
+#: ls-config.c:806
+#, c-format
+msgid "ERROR! Can't find parent element.\n"
+msgstr "BŁĄD! Nie można odnaleźć elementu nadrzędnego.\n"
+
+#: ls-config.c:813
+#, c-format
+msgid "ERROR! Variable unset failed.\n"
+msgstr "BŁĄD! Nie udało sią usunąć zmiennej.\n"
+
+#: ls-config.c:1115
+#, c-format
+msgid "Variable name: %s\n"
+msgstr "Nazwa zmiennej: %s\n"
+
+#: ls-config.c:1118
+#, c-format
+msgid "Variable type: %s\n"
+msgstr "Typ zmiennej: %s\n"
+
+#: ls-config.c:1121
+#, c-format
+msgid "Variable value: %s\n"
+msgstr "Wartość zmiennej: %s\n"
+
+#: ls-config.c:1124
+#, c-format
+msgid "Variable index: %d\n"
+msgstr "Index zmiennej: %d\n"
+
+#: ls-config.c:1127
+#, c-format
+msgid "Variable elements count: %d\n"
+msgstr "Ilość elementów zmiennej: %d\n"
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..4ed2c84
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,185 @@
+libconfig (1.6-1) unstable; urgency=low
+
+ * New upstream version
+
+ * Resync with Debian packaging. Thanks many, Jonathan & Matthias!
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Thu, 31 Dec 2015 17:01:20 +0100
+
+libconfig (1.5-0.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Upload to unstable.
+
+ -- Matthias Klose <doko@debian.org> Tue, 04 Aug 2015 17:20:08 +0200
+
+libconfig (1.5-0.1) experimental; urgency=medium
+
+ * Non maintainer upload.
+ * New upstream version.
+ * Rename libconfig++9v5 to libconfig++9v5, libstdc++6 ABI symbol changes.
+ Addresses: #791108.
+ * Add Conflicts/Replaces to the old library.
+ * Don't ship libconfig9.info in libconfig9, but only in libconfig-dev.
+ * Drop versioned dependency on pkg-config. Closes: #734482.
+ * Enable parallel builds. Closes: #759581.
+ * Only build the libconfig documentation for binary indep builds.
+ Closes: #759582.
+ * Add build dependency on texlive-fonts-recommended.
+ * Bump standards version to 3.9.6.
+
+ -- Matthias Klose <doko@ubuntu.com> Wed, 29 Jul 2015 12:46:50 +0200
+
+libconfig (1.4.9-2) unstable; urgency=medium
+
+ * Update short package description (Closes: #710783)
+ * Build using dh-autoreconf rather than autotools-dev; thanks to Matthias
+ Klose for this fix
+ * Add tex-workaround.patch from Matthias Klose to fix texinfo/tex FTBFS
+ * With sponsor's blessing, set myself as maintainer
+ * Bump Standards-Version to 3.9.5
+ - No changes required
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Sat, 28 Dec 2013 17:41:20 +0000
+
+libconfig (1.4.9-1) unstable; urgency=low
+
+ * New upstream release
+ * Update S-V to 3.9.4
+ - No changes necessary
+ * Ensure that libconfig++-dbg depends on libconfig9 (= ${binary:Version})
+ in addition to libconfig++9 (= ${binary:Version})
+ - Fixes dbg-package-missing-depends lintian warning
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Sat, 12 Oct 2013 16:41:14 +0100
+
+libconfig (1.4.8-5) unstable; urgency=low
+
+ * Switch to dh_9 style rules file
+ - Hardened buildflags now provided automatically
+ - Fixes E-binary-arch-produces-all buildd warning
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Tue, 26 Jun 2012 21:41:22 +0100
+
+libconfig (1.4.8-4) unstable; urgency=low
+
+ * Add C++ hardened buildflags
+ - Thanks to Simon Ruderich for the patch (closes: #662225)
+ * Fix libconfig(++)8-dev transition packages
+ - Set section as oldlibs
+ - Set priority as extra
+ - Remove package descriptions
+ * Add Multiarch support
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Fri, 06 Apr 2012 14:28:39 +0100
+
+libconfig (1.4.8-3) unstable; urgency=low
+
+ * Add Replaces+Breaks: libconfig(++)8-dev to libconfig(++)-dev
+ - Thanks to Andreas Beckmann for reporting (closes: #662643)
+ * Enable hardened buildflags
+ - Thanks to Simon Ruderich for the patch (closes: #662225)
+ * Fix incorrect section and arch for transitional packages.
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Mon, 05 Mar 2012 22:01:29 +0000
+
+libconfig (1.4.8-2) unstable; urgency=low
+
+ * Upload to unstable
+ * Update to S-V 3.9.3
+ * debian/rules now uses dpkg-buildflags
+ * Provide full transitional packages to help -dev package rename
+ * Multiple lintian fixes
+ - out-of-date-standards-version
+ - copyright-with-old-dh-make-debian-copyright
+ - extended-description-is-probably-too-short
+ - unneeded-build-dep-on-quilt
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Thu, 01 Mar 2012 02:11:47 +0000
+
+libconfig (1.4.8-1~exp1) experimental; urgency=low
+
+ * New upstream release (closes: #583528)
+ - soname bump to 9
+ * Update to S-V 3.9.2
+ * Update to Debhelper v7
+ * Refresh Build-Depends packages
+ * Add debug packages
+ * Remove soname from -dev package names
+ - Build as virtual packages for reverse dependency purposes.
+ * Fix examples (closes: #632081)
+
+ -- Jonathan McCrohan <jmccrohan@gmail.com> Sat, 11 Feb 2012 18:13:26 +0000
+
+libconfig (1.3.2-2) unstable; urgency=low
+
+ * Removed "conflicts" with older sonames (Closes: #536635)
+ * Added missing compile-time libconfig++8-dev dependencies
+ (libconfig8-dev) (Closes: #537311)
+
+ * Removed libtool's ".la" files (clients should use pkg-config)
+
+ * Updated to S-V 3.8.3 with no changes
+
+ * With many thanks to Christian Hammers, who kindly checked the package.
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Sun, 13 Sep 2009 04:25:14 +0200
+
+libconfig (1.3.2-1) unstable; urgency=low
+
+ * New upstream release (Closes: #521725)
+ - soname bump to 8
+ - Updated to S-V 3.8.1 with no changes
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Tue, 07 Apr 2009 21:13:16 +0200
+
+libconfig (1.3.2-0) unstable; urgency=low
+
+ * new upstream release
+ * use official Debian files as basis
+ * libconfig++8-dev depends on libconfig8-dev because libconfig.h++
+ includes libconfig.h which is in libconfig8-dev
+
+ -- Klaus Schneider <kschn@users.sourceforge.net> Wed, 18 Feb 2009 15:26:32 +0100
+
+libconfig (1.3.1-1) unstable; urgency=low
+
+ * First upload to Debian (Closes: #438683)
+
+ * New upstream release
+ - soname bump to 6.1
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Fri, 31 Oct 2008 22:13:47 +0100
+
+libconfig (1.3-1) unstable; urgency=low
+
+ * New upstream release
+
+ * Packaging
+ - Updated to S-V 3.8.0 with no changes
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Mon, 20 Jul 2008 19:55:23 +0200
+
+libconfig (1.1-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Mon, 2 Jul 2007 02:01:40 +0200
+
+libconfig (0.9-1) unstable; urgency=low
+
+ * Initial packaging
+
+ -- Jose Luis Tallon <jltallon@adv-solutions.net> Tue, 10 Oct 2006 01:42:09 +0200
+
+libconfigduo (1.2.1-1) unstable; urgency=low
+
+ * Release 1.2.1
+
+ -- Klaus Schneider <kschn@users.sourceforge.net> Thu, 31 Jan 2008 11:25:21 +0100
+
+libconfigduo (1.1.1-1) unstable; urgency=low
+
+ * Initial release
+
+ -- Klaus Schneider <kschn@users.sourceforge.net> Mon, 25 Jun 2007 16:21:56 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..687ac60
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,163 @@
+Source: libconfig
+Priority: optional
+Maintainer: Jonathan McCrohan <jmccrohan@gmail.com>
+Uploaders: Jose Luis Tallon <jltallon@adv-solutions.net>
+Build-Depends: debhelper (>= 9), dh-autoreconf, texinfo, g++ (>= 4:5)
+Build-Depends-Indep: texlive-latex-base, texlive-fonts-recommended
+Standards-Version: 3.9.6
+Homepage: http://www.hyperrealm.com/libconfig/
+Section: libs
+
+Package: libconfig9
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Multi-Arch: same
+Description: parsing/manipulation of structured configuration files
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files.
+
+Package: libconfig++9v5
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: libconfig++9
+Replaces: libconfig++9
+Multi-Arch: same
+Description: parsing/manipulation of structured configuration files (C++ binding)
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files.
+ .
+ This is the C++ binding.
+
+Package: libconfig-dev
+Section: libdevel
+Architecture: any
+Replaces: libconfig8-dev (<< 1.4.8)
+Breaks: libconfig8-dev (<< 1.4.8)
+Depends: libconfig9 (= ${binary:Version}), pkg-config, ${misc:Depends}
+Recommends: libconfig-doc
+Multi-Arch: same
+Description: parsing/manipulation of structured config files (development)
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files. Its main features are:
+ - A fully reentrant parser: Multiple configurations can be parsed in
+ concurrent threads at the same time.
+ - A simple, structured configuration file format: more readable and compact
+ than XML and more flexible than Windows' "INI" file format.
+ - A low-footprint implementation
+ - Proper documentation.
+ .
+ This package contains the files needed in order to use libconfig
+ in your own programs.
+
+Package: libconfig8-dev
+Depends: libconfig-dev, ${misc:Depends}
+Architecture: any
+Section: oldlibs
+Priority: extra
+Description: Transitional package for libconfig-dev
+ This is a transitional package for libconfig-dev, and can be safely removed
+ when no other package depends on it.
+
+Package: libconfig++-dev
+Section: libdevel
+Architecture: any
+Replaces: libconfig++8-dev (<< 1.4.8)
+Breaks: libconfig++8-dev (<< 1.4.8)
+Depends: libconfig++9v5 (= ${binary:Version}), libconfig-dev,
+ pkg-config, ${misc:Depends}
+Multi-Arch: same
+Description: parsing/manipulation of structured config files (C++ development)
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files. Its main features are:
+ - A fully reentrant parser: Multiple configurations can be parsed in
+ concurrent threads at the same time.
+ - A simple, structured configuration file format: more readable and compact
+ than XML and more flexible than Windows' "INI" file format.
+ - A low-footprint implementation
+ - Proper documentation.
+ .
+ This package contains the files needed in order to use libconfig
+ in your own C++ programs.
+
+Package: libconfig++8-dev
+Depends: libconfig++-dev, ${misc:Depends}
+Architecture: any
+Section: oldlibs
+Priority: extra
+Description: Transitional package for libconfig++-dev
+ This is a transitional package for libconfig++-dev, and can be safely removed
+ when no other package depends on it.
+
+
+Package: libconfig-dbg
+Section: debug
+Priority: extra
+Architecture: any
+Depends: libconfig9 (= ${binary:Version}), ${misc:Depends}
+Multi-Arch: same
+Description: parsing/manipulation of structured config files (debug symbols)
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files.
+ .
+ This package provides debugging information for the libconfig library.
+
+Package: libconfig++-dbg
+Section: debug
+Priority: extra
+Architecture: any
+Depends: libconfig9 (= ${binary:Version}), libconfig++9v5 (= ${binary:Version}), ${misc:Depends}
+Multi-Arch: same
+Description: parsing/manipulation of structured config files (C++ debug symbols)
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files.
+ .
+ This package provides debugging information for the libconfig++ library.
+
+Package: libconfig-doc
+Section: doc
+Architecture: all
+Replaces: libconfig-dev (<= 1.4.8)
+Breaks: libconfig-dev (<= 1.4.8)
+Depends: ${misc:Depends}
+Description: parsing/manipulation of structured config files (Documentation)
+ This library features a fully reentrant parser and includes bindings for
+ both the C and C++ programming languages. It runs on modern POSIX-compliant
+ systems such as Linux, Solaris, and Mac OS X (Darwin), as well as on
+ Microsoft Windows 2000/XP and later (Visual Studio or MinGW).
+ .
+ This library allows parsing, manipulating and writing structured configuration
+ files.
+ .
+ This package provides documentation for the libconfig library.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..94a3ec2
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,37 @@
+This package was debianized by Jose Luis Tallon <jltallon@adv-solutions.net> on
+Tue, 10 Oct 2006 01:42:09 +0200.
+
+It was downloaded from http://www.hyperrealm.com/libconfig
+
+Upstream Author: Mark A Lindner
+ Mark Lindner - Lead developer & maintainer.
+ Daniel Marjamdki - Enhancements & bugfixes.
+ Andrew Tytula - Windows Port.
+ Glenn Herteg - Enhancements, bugfixes, documentation corrections.
+ Jose Luis Tallon - Enhancements, bugfixes
+
+
+Copyright: Copyright (C) 2005-2015 Mark A Lindner
+
+License: LGPL-2.1
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+
+
+On Debian systems, the full text of GNU's Lesser General Public License can
+be found at /usr/share/common-licenses/LGPL-2.1
+
+
+The Debian packaging is
+copyright 2006-2009, Jose Luis Tallon <jltallon@adv-solutions.net>,
+copyright 2011-2015, Jonathan McCrohan <jmccrohan@gmail.com>
+and is licensed under the GPL version 2, see `/usr/share/common-licenses/GPL-2'.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..6845771
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+usr/lib
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..5502ed8
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+NEWS
+README
+TODO
diff --git a/debian/libconfig++-dev.examples b/debian/libconfig++-dev.examples
new file mode 100644
index 0000000..8ee5b2c
--- /dev/null
+++ b/debian/libconfig++-dev.examples
@@ -0,0 +1,3 @@
+examples/c++/example.cfg
+examples/c++/invalid.cfg
+examples/c++/example*.cpp
diff --git a/debian/libconfig++-dev.install b/debian/libconfig++-dev.install
new file mode 100644
index 0000000..75c2d47
--- /dev/null
+++ b/debian/libconfig++-dev.install
@@ -0,0 +1,4 @@
+debian/tmp/usr/include/libconfig.h++
+debian/tmp/usr/lib/*/libconfig++.a
+debian/tmp/usr/lib/*/libconfig++.so
+debian/tmp/usr/lib/*/pkgconfig/libconfig++.pc
diff --git a/debian/libconfig++9-dev.install b/debian/libconfig++9-dev.install
new file mode 100644
index 0000000..af3e1d8
--- /dev/null
+++ b/debian/libconfig++9-dev.install
@@ -0,0 +1,6 @@
+debian/tmp/usr/include/libconfig.h++
+debian/tmp/usr/lib/libconfig++.a
+debian/tmp/usr/lib/libconfig++.so
+debian/tmp/usr/lib/libconfig++.la
+debian/tmp/usr/lib/pkgconfig/libconfig++.pc
+debian/tmp/usr/lib/cmake/libconfig++/libconfig++Config.cmake
diff --git a/debian/libconfig++9.install b/debian/libconfig++9.install
new file mode 100644
index 0000000..35c586e
--- /dev/null
+++ b/debian/libconfig++9.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/libconfig++.so.9*
diff --git a/debian/libconfig++9v5.install b/debian/libconfig++9v5.install
new file mode 100644
index 0000000..f63c7e9
--- /dev/null
+++ b/debian/libconfig++9v5.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/*/libconfig++.so.9*
diff --git a/debian/libconfig-dev.examples b/debian/libconfig-dev.examples
new file mode 100644
index 0000000..6430e18
--- /dev/null
+++ b/debian/libconfig-dev.examples
@@ -0,0 +1,2 @@
+examples/c/example.cfg
+examples/c/example*.c
diff --git a/debian/libconfig-dev.info b/debian/libconfig-dev.info
new file mode 100644
index 0000000..628d7f3
--- /dev/null
+++ b/debian/libconfig-dev.info
@@ -0,0 +1 @@
+debian/tmp/usr/share/info/libconfig.info
diff --git a/debian/libconfig-dev.install b/debian/libconfig-dev.install
new file mode 100644
index 0000000..375054d
--- /dev/null
+++ b/debian/libconfig-dev.install
@@ -0,0 +1,4 @@
+debian/tmp/usr/include/libconfig.h
+debian/tmp/usr/lib/*/libconfig.a
+debian/tmp/usr/lib/*/libconfig.so
+debian/tmp/usr/lib/*/pkgconfig/libconfig.pc
diff --git a/debian/libconfig-doc.doc-base b/debian/libconfig-doc.doc-base
new file mode 100644
index 0000000..281715e
--- /dev/null
+++ b/debian/libconfig-doc.doc-base
@@ -0,0 +1,9 @@
+Document: libconfig9
+Title: libconfig manual
+Author: Mark A Lindner
+Abstract: This manual describes what libconfig is
+ and how it can be used to parse configuration files
+Section: Programming/C
+
+Format: PDF
+Files: /usr/share/doc/libconfig-doc/libconfig.pdf.gz
diff --git a/debian/libconfig-doc.docs b/debian/libconfig-doc.docs
new file mode 100644
index 0000000..49e707d
--- /dev/null
+++ b/debian/libconfig-doc.docs
@@ -0,0 +1 @@
+doc/libconfig.pdf
diff --git a/debian/libconfig9-dev.docs b/debian/libconfig9-dev.docs
new file mode 100644
index 0000000..49e707d
--- /dev/null
+++ b/debian/libconfig9-dev.docs
@@ -0,0 +1 @@
+doc/libconfig.pdf
diff --git a/debian/libconfig9-dev.install b/debian/libconfig9-dev.install
new file mode 100644
index 0000000..5b5ce02
--- /dev/null
+++ b/debian/libconfig9-dev.install
@@ -0,0 +1,5 @@
+debian/tmp/usr/include/libconfig.h
+debian/tmp/usr/lib/libconfig.a
+debian/tmp/usr/lib/libconfig.so
+debian/tmp/usr/lib/libconfig.la
+debian/tmp/usr/lib/pkgconfig/libconfig.pc
diff --git a/debian/libconfig9.info b/debian/libconfig9.info
new file mode 100644
index 0000000..628d7f3
--- /dev/null
+++ b/debian/libconfig9.info
@@ -0,0 +1 @@
+debian/tmp/usr/share/info/libconfig.info
diff --git a/debian/libconfig9.install b/debian/libconfig9.install
new file mode 100644
index 0000000..9064128
--- /dev/null
+++ b/debian/libconfig9.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/*/libconfig.so.9*
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..0d6db96
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,14 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+# # export DH_VERBOSE=1
+
+override_dh_auto_build-indep:
+ $(MAKE) -C doc pdf
+
+override_dh_strip:
+ dh_strip -p libconfig9 --dbg-package=libconfig-dbg
+ dh_strip -p libconfig++9v5 --dbg-package=libconfig++-dbg
+
+%:
+ dh $@ --parallel --with autoreconf
diff --git a/debian/shlibs b/debian/shlibs
new file mode 100644
index 0000000..cb75f12
--- /dev/null
+++ b/debian/shlibs
@@ -0,0 +1,2 @@
+libconfig 9 libconfig9
+libconfig++ 9 libconfig++9
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..cf03ff9
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+
+# Full-site-with-pattern [Version [Action]]
+http://www.hyperrealm.com/libconfig/index.html \
+ libconfig-(.+)\.tar\.gz
diff --git a/doc/LGPL.texi b/doc/LGPL.texi
new file mode 100644
index 0000000..e371ac0
--- /dev/null
+++ b/doc/LGPL.texi
@@ -0,0 +1,590 @@
+@c \input texinfo.tex @c -*-texinfo-*-
+@c
+@c %**start of header
+
+@c All text is ignored before the setfilename.
+@setfilename LGPL.info
+
+@center GNU LESSER GENERAL PUBLIC LICENSE
+@center Version 2.1, February 1999
+
+@sp 1
+
+Copyright @copyright{} 1991, 1999 Free Software Foundation, Inc.,
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+as the successor of the GNU Library Public License, version 2, hence the
+version number 2.1.]
+
+@sp 1
+@center Preamble
+@sp 1
+
+The licenses for most software are designed to take away your freedom to
+share and change it. By contrast, the GNU General Public Licenses are
+intended to guarantee your freedom to share and change free software--to
+make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the Free
+Software Foundation and other authors who decide to use it. You can use
+it too, but we suggest you first think carefully about whether this
+license or the ordinary General Public License is the better strategy to
+use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish); that you receive source code or can get it if
+you want it; that you can change the software and use pieces of it in
+new free programs; and that you are informed that you can do these
+things.
+
+To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or
+for a fee, you must give the recipients all the rights that we gave you.
+You must make sure that they, too, receive or can get the source code.
+If you link other code with the library, you must provide complete
+object files to the recipients, so that they can relink them with the
+library after making changes to the library and recompiling it. And you
+must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is
+no warranty for the free library. Also, if the library is modified by
+someone else and passed on, the recipients should know that what they
+have is not the original version, so that the original author's
+reputation will not be affected by problems that might be introduced by
+others.
+
+Finally, software patents pose a constant threat to the existence of any
+free program. We wish to make sure that a company cannot effectively
+restrict the users of a free program by obtaining a restrictive license
+from a patent holder. Therefore, we insist that any patent license
+obtained for a version of the library must be consistent with the full
+freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License. This license, the GNU Lesser General Public
+License, applies to certain designated libraries, and is quite different
+from the ordinary General Public License. We use this license for
+certain libraries in order to permit linking those libraries into
+non-free programs.
+
+When a program is linked with a library, whether statically or using a
+shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the entire
+combination fits its criteria of freedom. The Lesser General Public
+License permits more lax criteria for linking other code with the
+library.
+
+We call this license the ``Lesser'' General Public License because it does
+Less to protect the user's freedom than the ordinary General Public
+License. It also provides other free software developers Less of an
+advantage over competing non-free programs. These disadvantages are the
+reason we use the ordinary General Public License for many libraries.
+However, the Lesser license provides advantages in certain special
+circumstances.
+
+For example, on rare occasions, there may be a special need to encourage
+the widest possible use of a certain library, so that it becomes a
+de-facto standard. To achieve this, non-free programs must be allowed
+to use the library. A more frequent case is that a free library does
+the same job as widely used non-free libraries. In this case, there is
+little to gain by limiting the free library to free software only, so we
+use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of free
+software. For example, permission to use the GNU C Library in non-free
+programs enables many more people to use the whole GNU operating system,
+as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is linked
+with the Library has the freedom and the wherewithal to run that program
+using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+``work based on the library'' and a ``work that uses the library''. The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+@page
+
+@center GNU LESSER GENERAL PUBLIC LICENSE
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+@enumerate 0
+
+@sp 1
+@item
+This License Agreement applies to any software library or other program
+which contains a notice placed by the copyright holder or other
+authorized party saying it may be distributed under the terms of this
+Lesser General Public License (also called ``this License''). Each
+licensee is addressed as ``you''.
+
+A ``library'' means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+The ``Library'', below, refers to any such software library or work which
+has been distributed under these terms. A ``work based on the Library''
+means either the Library or any derivative work under copyright law:
+that is to say, a work containing the Library or a portion of it, either
+verbatim or with modifications and/or translated straightforwardly into
+another language. (Hereinafter, translation is included without
+limitation in the term ``modification''.)
+
+``Source code'' for a work means the preferred form of the work for making
+modifications to it. For a library, complete source code means all the
+source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and
+installation of the library.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of running
+a program using the Library is not restricted, and output from such a
+program is covered only if its contents constitute a work based on the
+Library (independent of the use of the Library in a tool for writing
+it). Whether that is true depends on what the Library does and what the
+program that uses the Library does.
+
+@sp 1
+@item
+You may copy and distribute verbatim copies of the Library's complete
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the notices
+that refer to this License and to the absence of any warranty; and
+distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+@sp 1
+@item
+You may modify your copy or copies of the Library or any portion of it,
+thus forming a work based on the Library, and copy and distribute such
+modifications or work under the terms of Section 1 above, provided that
+you also meet all of these conditions:
+
+@enumerate a
+
+@item
+The modified work must itself be a software library.
+
+@sp 1
+@item
+You must cause the files modified to carry prominent notices stating
+that you changed the files and the date of any change.
+
+@sp 1
+@item
+You must cause the whole of the work to be licensed at no charge to all
+third parties under the terms of this License.
+
+@sp 1
+@item
+If a facility in the modified Library refers to a function or a table of
+data to be supplied by an application program that uses the facility,
+other than as an argument passed when the facility is invoked, then you
+must make a good faith effort to ensure that, in the event an
+application does not supply such function or table, the facility still
+operates, and performs whatever part of its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a
+purpose that is entirely well-defined independent of the application.
+Therefore, Subsection 2d requires that any application-supplied function
+or table used by this function must be optional: if the application does
+not supply it, the square root function must still compute square
+roots.)
+
+@end enumerate
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library, and
+can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based on
+the Library, the distribution of the whole must be on the terms of this
+License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of a
+storage or distribution medium does not bring the other work under the
+scope of this License.
+
+@sp 1
+@item
+You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so that
+they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+Once this change is made in a given copy, it is irreversible for that
+copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the
+Library into a program that is not a library.
+
+@sp 1
+@item
+You may copy and distribute the Library (or a portion or derivative of
+it, under Section 2) in object code or executable form under the terms
+of Sections 1 and 2 above provided that you accompany it with the
+complete corresponding machine-readable source code, which must be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a
+designated place, then offering equivalent access to copy the source
+code from the same place satisfies the requirement to distribute the
+source code, even though third parties are not compelled to copy the
+source along with the object code.
+
+@sp 1
+@item
+A program that contains no derivative of any portion of the Library, but
+is designed to work with the Library by being compiled or linked with
+it, is called a ``work that uses the Library''. Such a work, in
+isolation, is not a derivative work of the Library, and therefore falls
+outside the scope of this License.
+
+However, linking a ``work that uses the Library'' with the Library creates
+an executable that is a derivative of the Library (because it contains
+portions of the Library), rather than a ``work that uses the library''.
+The executable is therefore covered by this License. Section 6 states
+terms for distribution of such executables.
+
+When a ``work that uses the Library'' uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be linked
+without the Library, or if the work is itself a library. The threshold
+for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure
+layouts and accessors, and small macros and small inline functions (ten
+lines or less in length), then the use of the object file is
+unrestricted, regardless of whether it is legally a derivative work.
+(Executables containing this object code plus portions of the Library
+will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6, whether
+or not they are linked directly with the Library itself.
+
+@sp 1
+@item
+As an exception to the Sections above, you may also combine or link a
+``work that uses the Library'' with the Library to produce a work
+containing portions of the Library, and distribute that work under terms
+of your choice, provided that the terms permit modification of the work
+for the customer's own use and reverse engineering for debugging such
+modifications.
+
+You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+@enumerate a
+
+@sp 1
+@item
+Accompany the work with the complete corresponding machine-readable
+source code for the Library including whatever changes were used in the
+work (which must be distributed under Sections 1 and 2 above); and, if
+the work is an executable linked with the Library, with the complete
+machine-readable ``work that uses the Library'', as object code and/or
+source code, so that the user can modify the Library and then relink to
+produce a modified executable containing the modified Library. (It is
+understood that the user who changes the contents of definitions files
+in the Library will not necessarily be able to recompile the application
+to use the modified definitions.)
+
+@sp 1
+@item
+Use a suitable shared library mechanism for linking with the Library. A
+suitable mechanism is one that (1) uses at run time a copy of the
+library already present on the user's computer system, rather than
+copying library functions into the executable, and (2) will operate
+properly with a modified version of the library, if the user installs
+one, as long as the modified version is interface-compatible with the
+version that the work was made with.
+
+@sp 1
+@item
+Accompany the work with a written offer, valid for at least three years,
+to give the same user the materials specified in Subsection 6a, above,
+for a charge no more than the cost of performing this distribution.
+
+@sp 1
+@item
+If distribution of the work is made by offering access to copy from a
+designated place, offer equivalent access to copy the above specified
+materials from the same place.
+
+@sp 1
+@item
+Verify that the user has already received a copy of these materials or
+that you have already sent this user a copy.
+
+@end enumerate
+
+For an executable, the required form of the ``work that uses the Library''
+must include any data and utility programs needed for reproducing the
+executable from it. However, as a special exception, the materials to
+be distributed need not include anything that is normally distributed
+(in either source or binary form) with the major components (compiler,
+kernel, and so on) of the operating system on which the executable runs,
+unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions
+of other proprietary libraries that do not normally accompany the
+operating system. Such a contradiction means you cannot use both them
+and the Library together in an executable that you distribute.
+
+@sp 1
+@item
+You may place library facilities that are a work based on the Library
+side-by-side in a single library together with other library facilities
+not covered by this License, and distribute such a combined library,
+provided that the separate distribution of the work based on the Library
+and of the other library facilities is otherwise permitted, and provided
+that you do these two things:
+
+@enumerate a
+
+@sp 1
+@item
+Accompany the combined library with a copy of the same work based on the
+Library, uncombined with any other library facilities. This must be
+distributed under the terms of the Sections above.
+
+@sp 1
+@item
+Give prominent notice with the combined library of the fact that part of
+it is a work based on the Library, and explaining where to find the
+accompanying uncombined form of the same work.
+
+@end enumerate
+
+@sp 1
+@item
+You may not copy, modify, sublicense, link with, or distribute the
+Library except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, link with, or distribute the
+Library is void, and will automatically terminate your rights under this
+License. However, parties who have received copies, or rights, from you
+under this License will not have their licenses terminated so long as
+such parties remain in full compliance.
+
+@sp 1
+@item
+You are not required to accept this License, since you have not signed
+it. However, nothing else grants you permission to modify or distribute
+the Library or its derivative works. These actions are prohibited by
+law if you do not accept this License. Therefore, by modifying or
+distributing the Library (or any work based on the Library), you
+indicate your acceptance of this License to do so, and all its terms and
+conditions for copying, distributing or modifying the Library or works
+based on it.
+
+@sp 1
+@item
+Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+@sp 1
+@item
+If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent license
+would not permit royalty-free redistribution of the Library by all those
+who receive copies directly or indirectly through you, then the only way
+you could satisfy both it and this License would be to refrain entirely
+from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is implemented
+by public license practices. Many people have made generous
+contributions to the wide range of software distributed through that
+system in reliance on consistent application of that system; it is up to
+the author/donor to decide if he or she is willing to distribute
+software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be
+a consequence of the rest of this License.
+
+@sp 1
+@item
+If the distribution and/or use of the Library is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Library under this License may add an
+explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+@sp 1
+@item
+The Free Software Foundation may publish revised and/or new versions of
+the Lesser General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and ``any
+later version'', you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a license
+version number, you may choose any version ever published by the Free
+Software Foundation.
+
+@sp 1
+@item
+If you wish to incorporate parts of the Library into other free programs
+whose distribution conditions are incompatible with these, write to the
+author to ask for permission. For software which is copyrighted by the
+Free Software Foundation, write to the Free Software Foundation; we
+sometimes make exceptions for this. Our decision will be guided by the
+two goals of preserving the free status of all derivatives of our free
+software and of promoting the sharing and reuse of software generally.
+
+@sp 1
+@center NO WARRANTY
+@sp 1
+
+@item
+BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE LIBRARY ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH
+YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+@sp 1
+@item
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
+DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
+DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY
+(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
+THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR
+OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+@end enumerate
+
+@sp 1
+@center END OF TERMS AND CONDITIONS
+@sp 1
+@page
+@center How to Apply These Terms to Your New Libraries
+
+If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of
+the ordinary General Public License).
+
+To apply these terms, attach the following notices to the library. It
+is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should have
+at least the ``copyright'' line and a pointer to where the full notice is
+found.
+
+@format
+@t{
+<one line to give the library's name and a brief idea of what it does.>
+Copyright (C) <year> <name of author>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+}
+@end format
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the library, if
+necessary. Here is a sample; alter the names:
+
+@format
+@t{
+Yoyodyne, Inc., hereby disclaims all copyright interest in the
+library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+<signature of Ty Coon>, 1 April 1990
+Ty Coon, President of Vice
+}
+@end format
+
+That's all there is to it!
+
+@c @bye
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..0a4383e
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,7 @@
+
+
+info_TEXINFOS = libconfig.texi
+libconfig_TEXINFOS = LGPL.texi
+
+html:
+ $(MAKEINFO) --html --no-split $(info_TEXINFOS)
diff --git a/doc/libconfig.texi b/doc/libconfig.texi
new file mode 100644
index 0000000..9645077
--- /dev/null
+++ b/doc/libconfig.texi
@@ -0,0 +1,2452 @@
+\input texinfo.tex @c -*-texinfo-*-
+@c
+@c %**start of header
+
+@c All text is ignored before the setfilename.
+@setfilename libconfig.info
+@settitle libconfig
+
+@set edition 1.7.3
+@set update-date 20 Jun 2021
+@set subtitle-text A Library For Processing Structured Configuration Files
+@set author-text Mark A.@: Lindner
+
+@comment %**end of header
+
+@firstparagraphindent insert
+
+@dircategory Software libraries
+@direntry
+* libconfig: (libconfig). A Library For Processing Structured Configuration Files
+@end direntry
+
+
+@tex
+\global\emergencystretch = .3\hsize
+@end tex
+
+@setchapternewpage odd
+
+@titlepage
+
+@title libconfig
+@subtitle @value{subtitle-text}
+@subtitle Version @value{edition}
+@subtitle @value{update-date}
+
+@author @value{author-text}
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 2004-2021 Mark A Lindner
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+@end titlepage
+
+@c Give the HTML output a title page that somewhat resembles the printed one
+@ifhtml
+@html
+<hr noshade size=6 color="black">
+<div align=right>@value{subtitle-text}<br>
+Version @value{edition}<br>
+@value{update-date}</div>
+<br><br><br><br>
+<font size=+1>@value{author-text}</font>
+<hr size=3 noshade color="black">
+<br><br>
+@end html
+@end ifhtml
+
+@contents
+
+@ifnottex
+@node Top
+@comment node-name, next, previous, up
+@top libconfig
+@end ifnottex
+
+@menu
+* Introduction::
+* Configuration Files::
+* The C API::
+* The C++ API::
+* Example Programs::
+* Other Bindings and Implementations::
+* License::
+* Configuration File Grammar::
+* Function Index::
+* Type Index::
+* Concept Index::
+@end menu
+
+@node Introduction, Configuration Files, Top, Top
+@comment node-name, next, previous, up
+@menu
+* Why Another Configuration File Library?::
+* Using the Library from a C Program::
+* Using the Library from a C++ Program::
+* Multithreading Issues::
+* Internationalization Issues::
+* Compiling Using pkg-config::
+* Version Test Macros::
+@end menu
+@chapter Introduction
+
+@i{Libconfig} is a library for reading, manipulating, and writing
+structured configuration files. The library features a fully
+reentrant parser and includes bindings for both the C and C++
+programming languages.
+
+The library runs on modern POSIX-compilant systems, such as Linux,
+Solaris, and Mac OS X (Darwin), as well as on Microsoft Windows
+2000/XP and later (with either Microsoft Visual Studio 2005 or later,
+or the GNU toolchain via the MinGW environment).
+
+@node Why Another Configuration File Library?, Using the Library from a C Program, , Introduction
+@comment node-name, next, previous, up
+@section Why Another Configuration File Library?
+
+There are several open-source configuration file libraries available
+as of this writing. This library was written because each of those
+libraries falls short in one or more ways. The main features of
+@i{libconfig} that set it apart from the other libraries are:
+
+@itemize @bullet
+
+@item A fully reentrant parser. Independent configurations can be parsed in concurrent threads at the same time.
+
+@item Both C @i{and} C++ bindings, as well as hooks to allow for the creation of wrappers in other languages.
+
+@item A simple, structured configuration file format that is more
+readable and compact than XML and more flexible than the obsolete but
+prevalent Windows ``INI'' file format.
+
+@item A low-footprint implementation (just 37K for the C library and 76K for
+the C++ library) that is suitable for memory-constrained systems.
+
+@item Proper documentation.
+
+@end itemize
+
+@node Using the Library from a C Program, Using the Library from a C++ Program, Why Another Configuration File Library?, Introduction
+@comment node-name, next, previous, up
+@section Using the Library from a C Program
+
+To use the library from C code, include the following preprocessor
+directive in your source files:
+
+@sp 1
+@smallexample
+#include <libconfig.h>
+@end smallexample
+@sp 1
+
+To link with the library, specify @samp{-lconfig} as an argument to the
+linker.
+
+@node Using the Library from a C++ Program, Multithreading Issues, Using the Library from a C Program, Introduction
+@comment node-name, next, previous, up
+@section Using the Library from a C++ Program
+
+To use the library from C++, include the following preprocessor
+directive in your source files:
+
+@sp 1
+@smallexample
+#include <libconfig.h++>
+@end smallexample
+@sp 1
+
+Or, alternatively:
+
+@sp 1
+@smallexample
+#include <libconfig.hh>
+@end smallexample
+@sp 1
+@page
+The C++ API classes are defined in the namespace @samp{libconfig}, hence the
+following statement may optionally be used:
+
+@sp 1
+@smallexample
+using namespace libconfig;
+@end smallexample
+@sp 1
+
+To link with the library, specify @samp{-lconfig++} as an argument to
+the linker.
+
+@node Multithreading Issues, Internationalization Issues, Using the Library from a C++ Program, Introduction
+@comment node-name, next, previous, up
+@section Multithreading Issues
+
+@i{Libconfig} is fully @dfn{reentrant}; the functions in the library
+do not make use of global variables and do not maintain state between
+successive calls. Therefore two independent configurations may be safely
+manipulated concurrently by two distinct threads.
+
+@i{Libconfig} is not @dfn{thread-safe}. The library is not aware of
+the presence of threads and knows nothing about the host system's
+threading model. Therefore, if an instance of a configuration is to be
+accessed from multiple threads, it must be suitably protected by
+synchronization mechanisms like read-write locks or mutexes; the
+standard rules for safe multithreaded access to shared data must be
+observed.
+
+@i{Libconfig} is not @dfn{async-safe}. Calls should not be made into
+the library from signal handlers, because some of the C library
+routines that it uses may not be async-safe.
+
+@i{Libconfig} is not guaranteed to be @dfn{cancel-safe}. Since it is
+not aware of the host system's threading model, the library does not
+contain any thread cancellation points. In most cases this will not be
+an issue for multithreaded programs. However, be aware that some of
+the routines in the library (namely those that read/write
+configurations from/to files or streams) perform I/O using C library
+routines which may potentially block; whether or not these C library
+routines are cancel-safe depends on the host system.
+
+@node Internationalization Issues, Compiling Using pkg-config, Multithreading Issues, Introduction
+@comment node-name, next, previous, up
+@section Internationalization Issues
+
+@cindex Unicode
+@cindex UTF-8
+@i{Libconfig} does not natively support Unicode configuration files,
+but string values may contain Unicode text encoded in UTF-8; such
+strings will be treated as ordinary 8-bit ASCII text by the
+library. It is the responsibility of the calling program to perform
+the necessary conversions to/from wide (@t{wchar_t}) strings using the
+wide string conversion functions such as @t{mbsrtowcs()} and
+@t{wcsrtombs()} or the @t{iconv()} function of the @i{libiconv}
+library.
+
+@cindex locale
+The textual representation of a floating point value varies by
+locale. However, the @i{libconfig} grammar specifies that
+floating point values are represented using a period (`.') as the
+radix symbol; this is consistent with the grammar of most programming
+languages. When a configuration is read in or written out,
+@i{libconfig} temporarily changes the @t{LC_NUMERIC} category of the
+locale of the calling thread to the ``C'' locale to ensure consistent
+handling of floating point values regardless of the locale(s) in use
+by the calling program.
+
+Note that the MinGW environment does not (as of this writing) provide
+functions for changing the locale of the calling thread. Therefore,
+when using @i{libconfig} in that environment, the calling program is
+responsible for changing the @t{LC_NUMERIC} category of the locale to
+the "C" locale before reading or writing a configuration.
+
+@node Compiling Using pkg-config, Version Test Macros, Internationalization Issues, Introduction
+@comment node-name, next, previous, up
+@section Compiling Using pkg-config
+
+@cindex pkg-config
+On UNIX systems you can use the @i{pkg-config} utility (version 0.20
+or later) to automatically select the appropriate compiler and linker
+switches for @i{libconfig}. Ensure that the environment variable
+@code{PKG_CONFIG_PATH} contains the absolute path to the
+@file{lib/pkgconfig} subdirectory of the @i{libconfig} installation. Then,
+you can compile and link C programs with @i{libconfig} as follows:
+
+@smallexample
+gcc `pkg-config --cflags libconfig` myprogram.c -o myprogram \
+ `pkg-config --libs libconfig`
+@end smallexample
+@sp 1
+
+And similarly, for C++ programs:
+
+@smallexample
+g++ `pkg-config --cflags libconfig++` myprogram.cpp -o myprogram \
+ `pkg-config --libs libconfig++`
+@end smallexample
+
+@sp 1
+Note the backticks in the above examples.
+
+When using @b{autoconf}, the @code{PKG_CHECK_MODULES} m4 macro may be used to check for the presence of a given version of @i{libconfig}, and set the appropriate Makefile variables automatically. For example:
+
+@smallexample
+PKG_CHECK_MODULES([LIBCONFIGXX], [libconfig++ >= 1.4],,
+ AC_MSG_ERROR([libconfig++ 1.4 or newer not found.])
+)
+@end smallexample
+
+In the above example, if @i{libconfig++} version 1.4 or newer is found,
+the Makefile variables @code{LIBCONFIGXX_LIBS} and @code{LIBCONFIGXX_CFLAGS} will be
+set to the appropriate compiler and linker flags for compiling with
+@i{libconfig}, and if it is not found, the configure script will abort
+with an error to that effect.
+
+@node Version Test Macros, , Compiling Using pkg-config, Introduction
+@comment node-name, next, previous, up
+@section Version Test Macros
+
+The @file{libconfig.h} header declares the following macros:
+
+@defmac LIBCONFIG_VER_MAJOR
+@defmacx LIBCONFIG_VER_MINOR
+@defmacx LIBCONFIG_VER_REVISION
+
+These macros represent the major version, minor version, and revision
+of the @i{libconfig} library. For example, in @i{libconfig} 1.4 these
+are defined as @samp{1}, @samp{4}, and @samp{0}, respectively. These
+macros can be used in preprocessor directives to determine which
+@i{libconfig} features and/or APIs are present. For example:
+
+@smallexample
+#if (((LIBCONFIG_VER_MAJOR == 1) && (LIBCONFIG_VER_MINOR >= 4)) \
+ || (LIBCONFIG_VER_MAJOR > 1))
+ /* use features present in libconfig 1.4 and later */
+#endif
+@end smallexample
+
+These macros were introduced in @i{libconfig} 1.4.
+
+@end defmac
+
+Similarly, the @file{libconfig.h++} header declares the following macros:
+
+@defmac LIBCONFIGXX_VER_MAJOR
+@defmacx LIBCONFIGXX_VER_MINOR
+@defmacx LIBCONFIGXX_VER_REVISION
+
+These macros represent the major version, minor version, and revision
+of the @i{libconfig++} library.
+
+@end defmac
+
+@node Configuration Files, The C API, Introduction, Top
+@comment node-name, next, previous, up
+@menu
+* Settings::
+* Groups::
+* Arrays::
+* Lists::
+* Integer Values::
+* 64-bit Integer Values::
+* Floating Point Values::
+* Boolean Values::
+* String Values::
+* Comments::
+* Include Directives::
+@end menu
+@chapter Configuration Files
+
+@i{Libconfig} supports structured, hierarchical configurations. These
+configurations can be read from and written to files and manipulated
+in memory.
+
+@cindex setting
+@cindex value
+@cindex scalar value
+@cindex array
+@cindex group
+@cindex list
+@cindex configuration
+A @dfn{configuration} consists of a group of @dfn{settings}, which
+associate names with values. A @dfn{value} can be one of the
+following:
+
+@itemize @bullet
+@item A @dfn{scalar value}: integer, 64-bit integer, floating-point number, boolean,
+or string
+@item An @dfn{array}, which is a sequence of scalar values, all of which must have the same type
+@item A @dfn{group}, which is a collection of settings
+@item A @dfn{list}, which is a sequence of values of any type, including other lists
+@end itemize
+
+Consider the following configuration file for a hypothetical GUI
+application, which illustrates all of the elements of the configuration
+file grammar.
+
+@sp 1
+@cartouche
+@smallexample
+# Example application configuration file
+
+version = "1.0";
+
+application:
+@{
+ window:
+ @{
+ title = "My Application";
+ size = @{ w = 640; h = 480; @};
+ pos = @{ x = 350; y = 250; @};
+ @};
+
+ list = ( ( "abc", 123, true ), 1.234, ( /* an empty list */ ) );
+
+ books = ( @{ title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.95;
+ qty = 5; @},
+ @{ title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8; @} );
+
+ misc:
+ @{
+ pi = 3.141592654;
+ bigint = 9223372036854775807L;
+ columns = [ "Last Name", "First Name", "MI" ];
+ bitmask = 0x1FC3; // hex
+ umask = 0027; // octal. Range limited to that of "int"
+ @};
+@};
+@end smallexample
+@end cartouche
+@sp 1
+
+@cindex path
+Settings can be uniquely identified within the configuration by a
+@dfn{path}. The path is a dot-separated sequence of names, beginning
+at a top-level group and ending at the setting itself. Each name in
+the path is the name of a setting; if the setting has no name because
+it is an element in a list or array, an integer index in square
+brackets can be used as the name.
+
+For example, in our hypothetical configuration file, the path to the
+@code{x} setting is @code{application.window.pos.x}; the path to the
+@code{version} setting is simply @code{version}; and the path to the
+@code{title} setting of the second book in the @code{books} list is
+@code{application.books.[1].title}.
+
+The datatype of a value is determined from the format of the value
+itself. If the value is enclosed in double quotes, it is treated as a
+string. If it looks like an integer or floating point number, it is
+treated as such. If it is one of the values @code{TRUE}, @code{true},
+@code{FALSE}, or @code{false} (or any other mixed-case version of
+those tokens, e.g., @code{True} or @code{FaLsE}), it is treated as a
+boolean. If it consists of a comma-separated list of values enclosed
+in square brackets, it is treated as an array. And if it consists of a
+comma-separated list of values enclosed in parentheses, it is treated
+as a list. Any value which does not meet any of these criteria is
+considered invalid and results in a parse error.
+
+All names are case-sensitive. They may consist only of alphanumeric
+characters, dashes (@samp{-}), underscores (@samp{_}), and asterisks
+(@samp{*}), and must begin with a letter or asterisk. No other
+characters are allowed.
+
+In C and C++, integer, 64-bit integer, floating point, and string
+values are mapped to the native types @code{int}, @code{long long},
+@code{double}, and @code{const char *}, respectively. The boolean type
+is mapped to @code{int} in C and @code{bool} in C++.
+
+The following sections describe the elements of the configuration file
+grammar in additional detail.
+
+@node Settings, Groups, , Configuration Files
+@comment node-name, next, previous, up
+@section Settings
+
+A setting has the form:
+
+@i{name} @b{=} @i{value} @b{;}
+
+or:
+
+@i{name} @b{:} @i{value} @b{;}
+
+The trailing semicolon is optional. Whitespace is not significant.
+
+The value may be a scalar value, an array, a group, or a list.
+
+@node Groups, Arrays, Settings, Configuration Files
+@comment node-name, next, previous, up
+@section Groups
+
+A group has the form:
+
+@b{@{}
+ @i{settings ...}
+@b{@}}
+
+Groups can contain any number of settings, but each setting must have
+a unique name within the group.
+
+@node Arrays, Lists, Groups, Configuration Files
+@comment node-name, next, previous, up
+@section Arrays
+
+An array has the form:
+
+@b{[} @i{value}@b{,} @i{value ...} @b{]}
+
+An array may have zero or more elements, but the elements must all be
+scalar values of the same type.
+
+The last element in an array may be followed by a comma, which will be ignored.
+
+@node Lists, Integer Values, Arrays, Configuration Files
+@comment node-name, next, previous, up
+@section Lists
+
+A list has the form:
+
+@b{(} @i{value}@b{,} @i{value ...} @b{)}
+
+A list may have zero or more elements, each of which can be a scalar
+value, an array, a group, or another list.
+
+The last element in a list may be followed by a comma, which will be ignored.
+
+@node Integer Values, 64-bit Integer Values, Lists, Configuration Files
+@comment node-name, next, previous, up
+@section Integer Values
+
+Integers can be represented in one of two ways: as a series of one or
+more decimal digits (@samp{0} - @samp{9}), with an optional leading
+sign character (@samp{+} or @samp{-}); or as a hexadecimal value
+consisting of the characters @samp{0x} followed by a series of one or
+more hexadecimal digits (@samp{0} - @samp{9}, @samp{A} - @samp{F},
+@samp{a} - @samp{f}). Additionally, octal notation integers (that is,
+those having a leading zero with non-zero value) are also allowed.
+
+@node 64-bit Integer Values, Floating Point Values, Integer Values, Configuration Files
+@comment node-name, next, previous, up
+@section 64-bit Integer Values
+
+Long long (64-bit) integers are represented identically to integers,
+except that an `L' character is appended to indicate a 64-bit
+value. For example, @samp{0L} indicates a 64-bit integer value 0. As
+of version 1.5 of the library, the trailing `L' is optional; if the
+integer value exceeds the range of a 32-bit integer, it will
+automatically be interpreted as a 64-bit integer.
+
+The @i{integer} and @i{64-bit integer} setting types are interchangeable to the
+extent that a conversion between the corresponding native types would not
+result in an overflow or underflow. For example, a @i{long long} value can be
+written to a setting that has an @i{integer} type, if that value is within the
+range of an @i{int}. This rule applies to every API function or method that
+reads a value from or writes a value to a setting: if the type conversion would
+not result in an overflow or underflow, then the call will succeed, and
+otherwise it will fail. This behavior was not well-defined prior to version 1.7
+of the library.
+
+@node Floating Point Values, Boolean Values, 64-bit Integer Values, Configuration Files
+@comment node-name, next, previous, up
+@section Floating Point Values
+
+Floating point values consist of a series of one or more digits, one
+decimal point, an optional leading sign character (@samp{+} or
+@samp{-}), and an optional exponent. An exponent consists of the
+letter @samp{E} or @samp{e}, an optional sign character, and a series
+of one or more digits.
+
+@node Boolean Values, String Values, Floating Point Values, Configuration Files
+@comment node-name, next, previous, up
+@section Boolean Values
+
+Boolean values may have one of the following values: @samp{true},
+@samp{false}, or any mixed-case variation thereof.
+
+@node String Values, Comments, Boolean Values, Configuration Files
+@comment node-name, next, previous, up
+@section String Values
+
+@cindex escape sequence
+String values consist of arbitrary text delimited by double
+quotes. Literal double quotes can be escaped by preceding them with a
+backslash: @samp{\"}. The escape sequences @samp{\\}, @samp{\f},
+@samp{\n}, @samp{\r}, and @samp{\t} are also recognized, and have the
+usual meaning.
+
+In addition, the @samp{\x} escape sequence is supported; this sequence
+must be followed by @i{exactly two} hexadecimal digits, which represent an
+8-bit ASCII value. For example, @samp{\xFF} represents the character
+with ASCII code 0xFF.
+
+No other escape sequences are currently supported.
+
+Adjacent strings are automatically concatenated, as in C/C++ source
+code. This is useful for formatting very long strings as sequences of
+shorter strings. For example, the following constructs are equivalent:
+
+@itemize @bullet
+@item
+@code{"The quick brown fox jumped over the lazy dog."}
+
+@item
+@code{"The quick brown fox"} @*
+@code{" jumped over the lazy dog."}
+
+@item
+@code{"The quick" /* comment */ " brown fox " // another comment} @*
+@code{"jumped over the lazy dog."}
+
+@end itemize
+@page
+@node Comments, Include Directives, String Values, Configuration Files
+@comment node-name, next, previous, up
+@section Comments
+
+@cindex comment
+Three types of comments are allowed within a configuration:
+
+@itemize @bullet
+
+@item Script-style comments. All text beginning with a @samp{#} character
+to the end of the line is ignored.
+
+@item C-style comments. All text, including line breaks, between a starting
+@samp{/*} sequence and an ending @samp{*/} sequence is ignored.
+
+@item C++-style comments. All text beginning with a @samp{//} sequence to the
+end of the line is ignored.
+
+@end itemize
+
+As expected, comment delimiters appearing within quoted strings are
+treated as literal text.
+
+Comments are ignored when the configuration is read in, so they are
+not treated as part of the configuration. Therefore if the
+configuration is written back out to a stream, any comments that were
+present in the original configuration will be lost.
+
+
+@node Include Directives, , Comments, Configuration Files
+@comment node-name, next, previous, up
+@section Include Directives
+
+@cindex include directive
+A configuration file may ``include'' the contents of other files
+using an @i{include directive}. This directive has the effect of
+inlining the contents of the named file(s) at the point of inclusion.
+
+An include directive must appear on its own line in the input. It has
+the form:
+
+@b{@@include "}@i{path}@b{"}
+
+@cindex include function
+The interpretation of @i{path} depends on the currently registered
+@i{include function}. The default include function prepends the include
+directory, if any, to @i{path}, and then interprets the result as a single,
+literal file path. The application may supply its own include function which
+does variable substitution, wildcard expansion, or other transformations,
+returning a list of zero or more paths to files whose contents should be inlined
+at the point of inclusion.
+
+Any backslashes or double quotes in the path must be escaped as
+@samp{\\} and @samp{\"}, respectively.
+
+For example, consider the following two configuration files:
+
+@cartouche
+@smallexample
+# file: quote.cfg
+quote = "Criticism may not be agreeable, but it is necessary."
+ " It fulfils the same function as pain in the human"
+ " body. It calls attention to an unhealthy state of"
+ " things.\n"
+ "\t--Winston Churchill";
+@end smallexample
+@end cartouche
+
+@cartouche
+@smallexample
+# file: test.cfg
+info: @{
+ name = "Winston Churchill";
+ @@include "quote.cfg"
+ country = "UK";
+@};
+@end smallexample
+@end cartouche
+
+The resulting configuration will be equivalent to one in which the
+contents of the file @samp{quote.cfg} appeared at the point where the
+include directive is placed.
+
+Include files may be nested to a maximum of 10 levels; exceeding this
+limit results in a parse error.
+
+When the path argument to an @b{@@include} directive is a relative
+path, then it will be interpreted as being relative to the include
+directory that has been been set by means of
+@code{config_set_include_dir()}. If no include directory has been set,
+then it will be taken as being relative to the program's current
+working directory.
+
+Like comments, include directives are not part of the configuration
+file syntax. They are processed before the configuration itself is
+parsed. Therefore, they are not preserved when the configuration is
+written back out to a stream. There is presently no support for
+programmatically inserting include directives into a configuration.
+
+@node The C API, The C++ API, Configuration Files, Top
+@comment node-name, next, previous, up
+@chapter The C API
+
+@tindex config_t
+@tindex config_setting_t
+This chapter describes the C library API. The type @i{config_t}
+represents a configuration, and the type @i{config_setting_t} represents
+a configuration setting.
+
+The boolean values @code{CONFIG_TRUE} and @code{CONFIG_FALSE} are
+macros defined as @code{(1)} and @code{(0)}, respectively.
+
+@deftypefun void config_init (@w{config_t * @var{config}})
+@deftypefunx void config_destroy (@w{config_t * @var{config}})
+
+These functions initialize and destroy the configuration object @var{config}.
+
+@code{config_init()} initializes the @i{config_t} structure pointed to by
+@var{config} as a new, empty configuration.
+
+@code{config_destroy()} destroys the configuration @var{config},
+deallocating all memory associated with the configuration, but does not
+attempt to deallocate the @i{config_t} structure itself.
+
+@end deftypefun
+
+@deftypefun void config_clear (@w{config_t * @var{config}})
+
+@b{Since @i{v1.7}}
+
+This function clears the configuration @var{config}. All child settings of the
+root setting are recursively destroyed. All other attributes of the configuration
+are left unchanged.
+
+@end deftypefun
+
+@deftypefun int config_read (@w{config_t * @var{config}}, @w{FILE * @var{stream}})
+
+This function reads and parses a configuration from the given
+@var{stream} into the configuration object @var{config}. It returns
+@code{CONFIG_TRUE} on success, or @code{CONFIG_FALSE} on failure; the
+@code{config_error_text()}, @code{config_error_file()},
+@code{config_error_line()}, and @code{config_error_type()} functions,
+described below, can be used to obtain information about the error.
+
+@end deftypefun
+
+@deftypefun int config_read_file (@w{config_t * @var{config}}, @w{const char * @var{filename}})
+
+This function reads and parses a configuration from the file named
+@var{filename} into the configuration object @var{config}. It returns
+@code{CONFIG_TRUE} on success, or @code{CONFIG_FALSE} on failure; the
+@code{config_error_text()} and @code{config_error_line()} functions,
+described below, can be used to obtain information about the error.
+
+@end deftypefun
+
+@deftypefun int config_read_string (@w{config_t * @var{config}}, @w{const char * @var{str}})
+
+This function reads and parses a configuration from the string
+@var{str} into the configuration object @var{config}. It returns
+@code{CONFIG_TRUE} on success, or @code{CONFIG_FALSE} on failure; the
+@code{config_error_text()} and @code{config_error_line()} functions,
+described below, can be used to obtain information about the error.
+
+@end deftypefun
+
+@deftypefun void config_write (@w{const config_t * @var{config}}, @w{FILE * @var{stream}})
+
+This function writes the configuration @var{config} to the given
+@var{stream}.
+
+@end deftypefun
+
+@deftypefun int config_write_file (@w{config_t * @var{config}}, @w{const char * @var{filename}})
+
+This function writes the configuration @var{config} to the file named
+@var{filename}. It returns @code{CONFIG_TRUE} on success, or
+@code{CONFIG_FALSE} on failure.
+
+@end deftypefun
+
+@deftypefun {const char *} config_error_text (@w{const config_t * @var{config}})
+@deftypefunx {const char *} config_error_file (@w{const config_t * @var{config}})
+@deftypefunx int config_error_line (@w{const config_t * @var{config}})
+
+These functions, which are implemented as macros, return the text,
+filename, and line number of the parse error, if one occurred during a
+call to @code{config_read()}, @code{config_read_string()}, or
+@code{config_read_file()}. Storage for the strings returned by
+@code{config_error_text()} and @code{config_error_file()} are managed
+by the library and released automatically when the configuration is
+destroyed; these strings must not be freed by the caller. If the error
+occurred in text that was read from a string or stream,
+@code{config_error_file()} will return NULL.
+
+@end deftypefun
+
+@deftypefun config_error_t config_error_type (@w{const config_t * @var{config}})
+@tindex config_error_t
+This function, which is implemented as a macro, returns the type of
+error that occurred during the last call to one of the read or write
+functions. The @var{config_error_t} type is an enumeration with the
+following values: @code{CONFIG_ERR_NONE}, @code{CONFIG_ERR_FILE_IO},
+@code{CONFIG_ERR_PARSE}. These represent success, a file I/O error,
+and a parsing error, respectively.
+
+@end deftypefun
+
+@deftypefun void config_set_include_dir (@w{config_t *@var{config}}, @w{const char *@var{include_dir}})
+@deftypefunx {const char *} config_get_include_dir (@w{const config_t *@var{config}})
+
+@code{config_set_include_dir()} specifies the include directory,
+@var{include_dir}, relative to which the files specified in
+@samp{@@include} directives will be located for the configuration
+@var{config}. By default, there is no include directory, and all
+include files are expected to be relative to the current working
+directory. If @var{include_dir} is @code{NULL}, the default behavior
+is reinstated.
+
+For example, if the include directory is set to @file{/usr/local/etc},
+the include directive @samp{@@include "configs/extra.cfg"} would include the
+file @file{/usr/local/etc/configs/extra.cfg}.
+
+@code{config_get_include_dir()} returns the current include directory for the
+configuration @var{config}, or @code{NULL} if none is set.
+
+@end deftypefun
+
+@deftypefun void config_set_include_func (@w{config_include_fn_t @var{func}})
+
+@b{Since @i{v1.7}}
+
+Specifies the include function @var{func} to use when processing
+include directives. If @var{func} is @code{NULL}, the default include function,
+@code{config_default_include_func()}, will be reinstated.
+
+@tindex config_include_fn_t
+The type @i{config_include_fn_t} is a type alias
+for a function whose signature is:
+
+@deftypefun @w{const char **} func (@w{config_t *@var{config}}, @w{const char *@var{include_dir}}, @w{const char *@var{path}}, @w{const char **@var{error}})
+
+The function receives the configuration @var{config}, the
+configuration's current include directory @var{include_dir}, the
+argument to the include directive @var{path}; and a pointer at which
+to return an error message @var{error}.
+
+On success, the function should return a @code{NULL}-terminated array
+of paths. Any relative paths must be relative to the program's current
+working directory. The contents of these files will be inlined at the point
+of inclusion, in the order that the paths appear in the
+array. Both the array and its elements should be heap allocated; the
+library will take ownership of and eventually free the strings in the
+array and the array itself.
+
+On failure, the function should return @code{NULL} and set @var{*error} to a
+static error string which should be used as the parse error for the
+configuration; the library does not take ownership of or free this string.
+
+The default include function, @code{config_default_include_func()},
+simply returns a @code{NULL}-terminated array containing either a copy
+of @var{path} if it's an absolute path, or a concatenation of
+@var{include_dir} and @var{path} if it's a relative path.
+
+@end deftypefun
+
+Application-supplied include functions can perform custom tasks like wildcard
+expansion or variable substitution. For example, consider the include directive:
+
+@cartouche
+@smallexample
+@@include "configs/*.cfg"
+@end smallexample
+@end cartouche
+
+The include function would be invoked with the path @samp{configs/*.cfg} and
+could do wildcard expansion on that path, returning a list of paths to files
+with the file extension @samp{.cfg} in the subdirectory @samp{configs}. Each of
+these files would then be inlined at the location of the include directive.
+
+Tasks like wildcard expansion and variable substitution are non-trivial to
+implement and typically require platform-specific code. In the interests of
+keeping the library as compact and platform-independent as possible,
+implementations of such include functions are not included.
+
+@end deftypefun
+
+@deftypefun {unsigned short} config_get_float_precision(@w{config_t *@var{config}})
+@deftypefunx void config_set_float_precision(@w{config_t *@var{config}}, @w{unsigned short @var{digits}})
+
+@b{Since @i{v1.6}}
+
+These functions get and set the number of decimal digits to output after the
+radix character when writing the configuration to a file or stream.
+
+Valid values for @var{digits} range from 0 (no decimals) to about 15
+(implementation defined). This parameter has no effect on parsing.
+
+The default float precision is 6.
+
+@end deftypefun
+
+@deftypefun int config_get_options (@w{config_t *@var{config}})
+@deftypefunx void config_set_options (@w{config_t *@var{config}}, @w{int @var{options}})
+
+These functions get and set the options for the configuration
+@var{config}. The options affect how configurations are read and
+written. The following options are defined:
+
+@table @code
+
+@item CONFIG_OPTION_AUTOCONVERT
+Turning this option on enables number auto-conversion for
+the configuration. When this feature is enabled, an attempt to retrieve a
+floating point setting's value into an integer (or vice versa), or
+store an integer to a floating point setting's value (or vice versa)
+will cause the library to silently perform the necessary conversion
+(possibly leading to loss of data), rather than reporting failure. By
+default this option is turned off.
+
+@item CONFIG_OPTION_SEMICOLON_SEPARATORS
+This option controls whether a semicolon (`;') is output after each setting
+when the configuration is written to a file or stream. (The semicolon
+separators are optional in the configuration syntax.) By default this
+option is turned on.
+
+@item CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS
+This option controls whether a colon (`:') is output between each
+group setting's name and its value when the configuration is written to
+a file or stream. If the option is turned off, an equals sign (`=') is
+output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned on.
+
+@item CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS
+This option controls whether a colon (`:') is output between each
+non-group setting's name and its value when the configuration is written
+to a file or stream. If the option is turned off, an equals sign (`=')
+is output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned off.
+
+@item CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE
+This option controls whether an open brace (`@{') will be written on its own
+line when the configuration is written to a file or stream. If the option is
+turned off, the brace will be written at the end of the previous line.
+By default this option is turned on.
+
+@item CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION
+(@b{Since @i{v1.7}})
+This option controls whether scientific notation may be used as appropriate
+when writing floating point values (corresponding to @code{printf()}
+@samp{%g} format) or should never be used (corresponding to @code{printf()}
+@samp{%f} format). By default this option is turned off.
+
+@item CONFIG_OPTION_FSYNC
+(@b{Since @i{v1.7.1}})
+This option controls whether the @code{config_write_file()} function performs
+an @i{fsync} operation after writing the configuration and before closing the
+file. By default this option is turned off.
+
+@item CONFIG_OPTION_ALLOW_OVERRIDES
+(@b{Since @i{v1.7.3}})
+This option controls whether duplicate settings override previous settings
+with the same name. If this option is turned off, duplicate settings are
+rejected. By default this option is turned off.
+
+@end table
+
+@end deftypefun
+
+@deftypefun int config_get_option (@w{config_t *@var{config}}, @w{int @var{option}})
+@deftypefunx void config_set_option (@w{config_t *@var{config}}, @w{int @var{option}}, @w{int @var{flag}})
+
+@b{Since @i{v1.7}}
+
+These functions get and set the given @var{option} of the configuration
+@var{config}. The option is enabled if @var{flag} is @code{CONFIG_TRUE} and
+disabled if it is @code{CONFIG_FALSE}.
+
+See @code{config_set_options()} above for the list of available options.
+
+@end deftypefun
+
+
+@deftypefun int config_get_auto_convert (@w{const config_t *@var{config}})
+@deftypefunx void config_set_auto_convert (@w{config_t *@var{config}}, @w{int @var{flag}})
+
+These functions get and set the @code{CONFIG_OPTION_AUTO_CONVERT}
+option. They are obsoleted by the @code{config_set_option()} and
+@code{config_get_option()} functions described above.
+
+@end deftypefun
+
+@deftypefun short config_get_default_format (@w{config_t * @var{config}})
+@deftypefunx void config_set_default_format (@w{config_t * @var{config}}, @w{short @var{format}})
+
+These functions, which are implemented as macros, get and set the
+default external format for settings in the configuration
+@var{config}. If a non-default format has not been set for a setting
+with @code{config_setting_set_format()}, this configuration-wide
+default format will be used instead when that setting is written to a
+file or stream.
+
+@end deftypefun
+
+@deftypefun {unsigned short} config_get_tab_width (@w{const config_t * @var{config}})
+@deftypefunx void config_set_tab_width (@w{config_t * @var{config}}, @w{unsigned short @var{width}})
+
+These functions, which are implemented as macros, get and set the tab
+width for the configuration @var{config}. The tab width affects the
+formatting of the configuration when it is written to a file or
+stream: each level of nesting is indented by @var{width} spaces, or
+by a single tab character if @var{width} is 0. The tab width has no
+effect on parsing.
+
+Valid tab widths range from 0 to 15. The default tab width is 2.
+
+@end deftypefun
+
+@deftypefun int config_lookup_int (@w{const config_t * @var{config}}, @w{const char * @var{path}}, @w{int * @var{value}})
+@deftypefunx int config_lookup_int64 (@w{const config_t * @var{config}}, @w{const char * @var{path}}, @w{long long * @var{value}})
+@deftypefunx int config_lookup_float (@w{const config_t * @var{config}}, @w{const char * @var{path}}, @w{double * @var{value}})
+@deftypefunx int config_lookup_bool (@w{const config_t * @var{config}}, @w{const char * @var{path}}, @w{int * @var{value}})
+@deftypefunx int config_lookup_string (@w{const config_t * @var{config}}, @w{const char * @var{path}}, @w{const char ** @var{value}})
+
+These functions look up the value of the setting in the configuration
+@var{config} specified by the path @var{path}. They store the value of
+the setting at @var{value} and return @code{CONFIG_TRUE} on
+success. If the setting was not found or if the type of the value did
+not match the type requested, they leave the data pointed to by
+@var{value} unmodified and return @code{CONFIG_FALSE}.
+
+Storage for the string returned by @code{config_lookup_string()} is
+managed by the library and released automatically when the setting is
+destroyed or when the setting's value is changed; the string must not
+be freed by the caller.
+
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_lookup (@w{const config_t * @var{config}}, @w{const char * @var{path}})
+
+This function locates the setting in the configuration @var{config}
+specified by the path @var{path}. It returns a pointer to the
+@code{config_setting_t} structure on success, or @code{NULL} if the
+setting was not found.
+
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_setting_lookup (@w{const config_setting_t * @var{setting}}, @w{const char * @var{path}})
+
+This function locates a setting by a path @var{path} relative to
+the setting @var{setting}. It returns a pointer to the
+@code{config_setting_t} structure on success, or @code{NULL} if the
+setting was not found.
+
+@end deftypefun
+
+@deftypefun int config_setting_get_int (@w{const config_setting_t * @var{setting}})
+@deftypefunx {long long} config_setting_get_int64 (@w{const config_setting_t * @var{setting}})
+@deftypefunx double config_setting_get_float (@w{const config_setting_t * @var{setting}})
+@deftypefunx int config_setting_get_bool (@w{const config_setting_t * @var{setting}})
+@deftypefunx {const char *} config_setting_get_string (@w{const config_setting_t * @var{setting}})
+
+These functions return the value of the given @var{setting}. If the
+type of the setting does not match the type requested, a 0 or
+@code{NULL} value is returned. Storage for the string returned by
+@code{config_setting_get_string()} is managed by the library and
+released automatically when the setting is destroyed or when the
+setting's value is changed; the string must not be freed by the
+caller.
+
+@end deftypefun
+@deftypefun int config_setting_set_int (@w{config_setting_t * @var{setting}}, @w{int @var{value}})
+@deftypefunx int config_setting_set_int64 (@w{config_setting_t * @var{setting}}, @w{long long @var{value}})
+@deftypefunx int config_setting_set_float (@w{config_setting_t * @var{setting}}, @w{double @var{value}})
+@deftypefunx int config_setting_set_bool (@w{config_setting_t * @var{setting}}, @w{int @var{value}})
+@deftypefunx int config_setting_set_string (@w{config_setting_t * @var{setting}}, @w{const char * @var{value}})
+
+These functions set the value of the given @var{setting} to
+@var{value}. On success, they return @code{CONFIG_TRUE}. If
+the setting does not match the type of the value, they return
+@code{CONFIG_FALSE}. @code{config_setting_set_string()} makes a copy
+of the passed string @var{value}, so it may be subsequently freed or
+modified by the caller without affecting the value of the setting.
+
+@end deftypefun
+
+@deftypefun int config_setting_lookup_int (@w{const config_setting_t * @var{setting}}, @w{const char * @var{name}}, @w{int * @var{value}})
+@deftypefunx int config_setting_lookup_int64 (@w{const config_setting_t * @var{setting}}, @w{const char * @var{name}}, @w{long long * @var{value}})
+@deftypefunx int config_setting_lookup_float (@w{const config_setting_t * @var{setting}}, @w{const char * @var{name}}, @w{double * @var{value}})
+@deftypefunx int config_setting_lookup_bool (@w{const config_setting_t * @var{setting}}, @w{const char * @var{name}}, @w{int * @var{value}})
+@deftypefunx int config_setting_lookup_string (@w{const config_setting_t * @var{setting}}, @w{const char * @var{name}}, @w{const char ** @var{value}})
+
+These functions look up the value of the child setting named
+@var{name} of the setting @var{setting}. They store the value at
+@var{value} and return @code{CONFIG_TRUE} on success. If the setting
+was not found or if the type of the value did not match the type
+requested, they leave the data pointed to by @var{value} unmodified
+and return @code{CONFIG_FALSE}.
+
+Storage for the string returned by @code{config_setting_lookup_string()} is
+managed by the library and released automatically when the setting is
+destroyed or when the setting's value is changed; the string must not
+be freed by the caller.
+
+@end deftypefun
+
+@deftypefun short config_setting_get_format (@w{config_setting_t * @var{setting}})
+@deftypefunx int config_setting_set_format (@w{config_setting_t * @var{setting}}, @w{short @var{format}})
+
+These functions get and set the external format for the setting @var{setting}.
+
+@tindex SettingFormat
+@cindex format
+
+The @var{format} must be one of the constants
+@code{CONFIG_FORMAT_DEFAULT} or @code{CONFIG_FORMAT_HEX}. All settings
+support the @code{CONFIG_FORMAT_DEFAULT} format. The
+@code{CONFIG_FORMAT_HEX} format specifies hexadecimal formatting for
+integer values, and hence only applies to settings of type
+@code{CONFIG_TYPE_INT} and @code{CONFIG_TYPE_INT64}. If @var{format}
+is invalid for the given setting, it is ignored.
+
+If a non-default format has not been set for the setting, @code{config_setting_get_format()} returns the default format for the configuration, as set by @code{config_set_default_format()}.
+
+@code{config_setting_set_format()} returns @code{CONFIG_TRUE} on
+success and @code{CONFIG_FALSE} on failure.
+
+@end deftypefun
+
+
+@deftypefun {config_setting_t *} config_setting_get_member (@w{config_setting_t * @var{setting}}, @w{const char * @var{name}})
+
+This function fetches the child setting named @var{name} from the group
+@var{setting}. It returns the requested setting on success, or
+@code{NULL} if the setting was not found or if @var{setting} is not a
+group.
+
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_setting_get_elem (@w{const config_setting_t * @var{setting}}, @w{unsigned int @var{index}})
+
+This function fetches the element at the given index @var{index} in the
+setting @var{setting}, which must be an array, list, or group. It returns the
+requested setting on success, or @code{NULL} if @var{index} is out of
+range or if @var{setting} is not an array, list, or group.
+
+@end deftypefun
+
+@deftypefun int config_setting_get_int_elem (@w{const config_setting_t * @var{setting}}, @w{int @var{index}})
+@deftypefunx {long long} config_setting_get_int64_elem (@w{const config_setting_t * @var{setting}}, @w{int @var{index}})
+@deftypefunx double config_setting_get_float_elem (@w{const config_setting_t * @var{setting}}, @w{int @var{index}})
+@deftypefunx int config_setting_get_bool_elem (@w{const config_setting_t * @var{setting}}, @w{int @var{index}})
+@deftypefunx {const char *} config_setting_get_string_elem (@w{const config_setting_t * @var{setting}}, @w{int @var{index}})
+
+These functions return the value at the specified index @var{index} in the
+setting @var{setting}. If the setting is not an array or list, or if
+the type of the element does not match the type requested, or if
+@var{index} is out of range, they return 0 or @code{NULL}. Storage for
+the string returned by @code{config_setting_get_string_elem()} is
+managed by the library and released automatically when the setting is
+destroyed or when its value is changed; the string must not be freed
+by the caller.
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_setting_set_int_elem (@w{config_setting_t * @var{setting}}, @w{int @var{index}}, @w{int @var{value}})
+@deftypefunx {config_setting_t *} config_setting_set_int64_elem (@w{config_setting_t * @var{setting}}, @w{int @var{index}}, @w{long long @var{value}})
+@deftypefunx {config_setting_t *} config_setting_set_float_elem (@w{config_setting_t * @var{setting}}, @w{int @var{index}}, @w{double @var{value}})
+@deftypefunx {config_setting_t *} config_setting_set_bool_elem (@w{config_setting_t * @var{setting}}, @w{int @var{index}}, @w{int @var{value}})
+@deftypefunx {config_setting_t *} config_setting_set_string_elem (@w{config_setting_t * @var{setting}}, @w{int @var{index}}, @w{const char * @var{value}})
+
+These functions set the value at the specified index @var{index} in the
+setting @var{setting} to @var{value}. If @var{index} is negative, a
+new element is added to the end of the array or list. On success,
+these functions return a pointer to the setting representing the
+element. If the setting is not an array or list, or if the setting is
+an array and the type of the array does not match the type of the
+value, or if @var{index} is out of range, they return
+@code{NULL}. @code{config_setting_set_string_elem()} makes a copy of
+the passed string @var{value}, so it may be subsequently freed or
+modified by the caller without affecting the value of the setting.
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_setting_add (@w{config_setting_t * @var{parent}}, @w{const char * @var{name}}, @w{int @var{type}})
+
+This function adds a new child setting or element to the setting
+@var{parent}, which must be a group, array, or list. If @var{parent}
+is an array or list, the @var{name} parameter is ignored and may be
+@code{NULL}.
+
+The function returns the new setting on success, or @code{NULL} if
+@var{parent} is not a group, array, or list; or if there is already a
+child setting of @var{parent} named @var{name}; or if @var{type} is
+invalid. If @var{type} is a scalar type, the new setting will have a
+default value of 0, 0.0, @code{false}, or @code{NULL}, as appropriate.
+@end deftypefun
+
+@deftypefun int config_setting_remove (@w{config_setting_t * @var{parent}}, @w{const char * @var{name}})
+
+This function removes and destroys the setting named @var{name} from
+the parent setting @var{parent}, which must be a group. Any child
+settings of the setting are recursively destroyed as well.
+
+The @var{name} parameter can also specify a setting @i{path} relative to
+the provided @var{parent}.
+(In that case, the setting will be looked up and removed.)
+
+The function returns @code{CONFIG_TRUE} on success. If @var{parent} is
+not a group, or if it has no setting with the given name, it returns
+@code{CONFIG_FALSE}.
+
+@end deftypefun
+
+@deftypefun int config_setting_remove_elem (@w{config_setting_t * @var{parent}}, @w{unsigned int @var{index}})
+
+This function removes the child setting at the given index @var{index} from
+the setting @var{parent}, which must be a group, list, or array. Any
+child settings of the removed setting are recursively destroyed as
+well.
+
+The function returns @code{CONFIG_TRUE} on success. If @var{parent} is
+not a group, list, or array, or if @var{index} is out of range, it returns
+@code{CONFIG_FALSE}.
+
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_root_setting (@w{const config_t * @var{config}})
+
+This function, which is implemented as a macro, returns the root setting for the configuration @var{config}. The root setting is a group.
+
+@end deftypefun
+
+@deftypefun {const char *} config_setting_name (@w{const config_setting_t * @var{setting}})
+
+This function returns the name of the given @var{setting}, or
+@code{NULL} if the setting has no name. Storage for the returned
+string is managed by the library and released automatically when the
+setting is destroyed; the string must not be freed by the caller.
+
+@end deftypefun
+
+@deftypefun {config_setting_t *} config_setting_parent (@w{const config_setting_t * @var{setting}})
+
+This function returns the parent setting of the given @var{setting},
+or @code{NULL} if @var{setting} is the root setting.
+
+@end deftypefun
+
+@deftypefun int config_setting_is_root (@w{const config_setting_t * @var{setting}})
+
+This function returns @code{CONFIG_TRUE} if the given @var{setting} is
+the root setting, and @code{CONFIG_FALSE} otherwise.
+
+@end deftypefun
+
+@deftypefun int config_setting_index (@w{const config_setting_t * @var{setting}})
+
+This function returns the index of the given @var{setting} within its
+parent setting. If @var{setting} is the root setting, this function
+returns -1.
+
+@end deftypefun
+
+@deftypefun int config_setting_length (@w{const config_setting_t * @var{setting}})
+
+This function returns the number of settings in a group, or the number of
+elements in a list or array. For other types of settings, it returns
+0.
+
+@end deftypefun
+
+@deftypefun int config_setting_type (@w{const config_setting_t * @var{setting}})
+
+This function returns the type of the given @var{setting}. The return
+value is one of the constants
+@code{CONFIG_TYPE_INT}, @code{CONFIG_TYPE_INT64}, @code{CONFIG_TYPE_FLOAT},
+@code{CONFIG_TYPE_STRING}, @code{CONFIG_TYPE_BOOL},
+@code{CONFIG_TYPE_ARRAY}, @code{CONFIG_TYPE_LIST}, or @code{CONFIG_TYPE_GROUP}.
+
+@end deftypefun
+
+@deftypefun int config_setting_is_group (@w{const config_setting_t * @var{setting}})
+@deftypefunx int config_setting_is_array (@w{const config_setting_t * @var{setting}})
+@deftypefunx int config_setting_is_list (@w{const config_setting_t * @var{setting}})
+
+These convenience functions, which are implemented as macros, test if
+the setting @var{setting} is of a given type. They return
+@code{CONFIG_TRUE} or @code{CONFIG_FALSE}.
+
+@end deftypefun
+
+@deftypefun int config_setting_is_aggregate (@w{const config_setting_t * @var{setting}})
+@deftypefunx int config_setting_is_scalar (@w{const config_setting_t * @var{setting}})
+@deftypefunx int config_setting_is_number (@w{const config_setting_t * @var{setting}})
+
+@cindex aggregate value
+These convenience functions, some of which are implemented as macros, test if
+the setting @var{setting} is of an aggregate type (a group, array, or
+list), of a scalar type (integer, 64-bit integer, floating point,
+boolean, or string), and of a number (integer, 64-bit integer, or
+floating point), respectively. They return @code{CONFIG_TRUE} or
+@code{CONFIG_FALSE}.
+
+@end deftypefun
+
+@deftypefun {const char *} config_setting_source_file (@w{const config_setting_t * @var{setting}})
+
+This function returns the name of the file from which the setting
+@var{setting} was read, or NULL if the setting was not read from a
+file. This information is useful for reporting application-level
+errors. Storage for the returned string is managed by the library and
+released automatically when the configuration is destroyed; the
+string must not be freed by the caller.
+
+@end deftypefun
+
+@deftypefun {unsigned int} config_setting_source_line (@w{const config_setting_t * @var{setting}})
+
+This function returns the line number of the configuration file or
+stream at which the setting @var{setting} was read, or 0 if no line
+number is available. This information is useful for reporting
+application-level errors.
+
+@end deftypefun
+
+@deftypefun void config_set_hook (@w{config_t * @var{config}}, @w{void * @var{hook}})
+@deftypefunx {void *} config_get_hook (@w{const config_t * @var{config}})
+
+@b{Since @i{v1.7}}
+
+@cindex hook
+These functions make it possible to attach arbitrary data to a configuration
+structure, for instance a ``wrapper'' or ``peer'' object written in
+another programming language.
+
+@end deftypefun
+
+@deftypefun void config_setting_set_hook (@w{config_setting_t * @var{setting}}, @w{void * @var{hook}})
+@deftypefunx {void *} config_setting_get_hook (@w{const config_setting_t * @var{setting}})
+
+@cindex hook
+These functions make it possible to attach arbitrary data to each
+setting structure, for instance a ``wrapper'' or ``peer'' object written in
+another programming language. The destructor function, if one has been
+supplied via a call to @code{config_set_destructor()}, will be called
+by the library to dispose of this data when the setting itself is
+destroyed. There is no default destructor.
+
+@end deftypefun
+
+@deftypefun void config_set_destructor (@w{config_t * @var{config}}, @w{void (* @var{destructor})(void *)})
+
+@cindex destructor function
+This function assigns the destructor function @var{destructor} for the
+configuration @var{config}. This function accepts a single @code{void
+*} argument and has no return value. See
+@code{config_setting_set_hook()} above for more information.
+
+@end deftypefun
+
+@node The C++ API, Example Programs, The C API, Top
+@comment node-name, next, previous, up
+@chapter The C++ API
+
+@tindex Config
+@tindex Setting
+This chapter describes the C++ library API. The class @code{Config}
+represents a configuration, and the class @code{Setting} represents a
+configuration setting. Note that by design, neither of these classes
+provides a public copy constructor or assignment operator. Therefore,
+instances of these classes may only be passed between functions via
+references or pointers.
+
+@tindex ConfigException
+The library defines a group of exceptions, all of which extend the
+common base exception @code{ConfigException}.
+
+@tindex SettingTypeException
+A @code{SettingTypeException} is thrown when the type of a setting's
+value does not match the type requested.
+
+@deftypemethod SettingTypeException {} SettingTypeException (@w{const Setting &@var{setting}})
+@deftypemethodx SettingTypeException {} SettingTypeException (@w{const Setting &@var{setting}}, @w{int @var{index}})
+@deftypemethodx SettingTypeException {} SettingTypeException (@w{const Setting &@var{setting}}, @w{const char *@var{name}})
+
+These methods construct @code{SettingTypeException} objects for the given @var{setting} and/or member @var{index} or @var{name}.
+
+@end deftypemethod
+
+@tindex SettingNotFoundException
+A @code{SettingNotFoundException} is thrown when a setting is not found.
+
+@deftypemethod SettingNotFoundException {} SettingNotFoundException (@w{const Setting &@var{setting}}, @w{int @var{index}})
+@deftypemethodx SettingNotFoundException {} SettingNotFoundException (@w{const Setting &@var{setting}}, @w{const char *@var{name}})
+@deftypemethodx SettingNotFoundException {} SettingNotFoundException (@w{const char *@var{path}})
+
+These methods construct @code{SettingTypeException} objects for the given @var{setting} and member @var{index} or @var{name}, or path @var{path}.
+
+@end deftypemethod
+
+@tindex SettingNameException
+A @code{SettingNameException} is thrown when an attempt is made to add
+a new setting with a non-unique or invalid name.
+
+@deftypemethod SettingNameException {} SettingNameException (@w{const Setting &@var{setting}}, @w{const char *@var{name}})
+
+This method constructs a @code{SettingNameExcpetion} object for the given @var{setting} and member name @var{name}.
+
+@end deftypemethod
+
+@tindex ParseException
+A @code{ParseException} is thrown when a parse error occurs while
+reading a configuration from a stream.
+
+@deftypemethod ParseException {} ParseException (@w{const char *@var{file}}, @w{int @var{line}}, @w{const char *@var{error}})
+
+This method constructs a @code{ParseException} object with the given filename @var{file}, line number @var{line}, and error message @var{error}.
+
+@end deftypemethod
+
+@tindex FileIOException
+A @code{FileIOException} is thrown when an I/O error occurs while
+reading/writing a configuration from/to a file.
+
+@tindex SettingException
+@code{SettingTypeException}, @code{SettingNotFoundException}, and
+@code{SettingNameException} all extend the common base
+exception @code{SettingException}, which provides the following method:
+
+@deftypemethod SettingException {const char *} getPath () const
+
+This method returns the path to the setting associated with the exception, or
+@code{NULL} if there is no applicable path.
+
+@end deftypemethod
+
+The remainder of this chapter describes the methods for manipulating
+configurations and configuration settings.
+
+@deftypemethod Config {} Config ()
+@deftypemethodx Config {} ~Config ()
+
+These methods create and destroy @code{Config} objects.
+
+@end deftypemethod
+
+@deftypemethod Config void clear ()
+
+@b{Since @i{v1.7}}
+
+This method clears the configuration. All child settings of the root
+setting are recursively destroyed. All other attributes of the
+configuration are left unchanged.
+
+@end deftypemethod
+
+@deftypemethod Config void read (@w{FILE * @var{stream}})
+@deftypemethodx Config void write (@w{FILE * @var{stream}}) const
+
+The @code{read()} method reads and parses a configuration from the given
+@var{stream}. A @code{ParseException} is thrown if a parse error occurs.
+
+The @code{write()} method writes the configuration to the given @var{stream}.
+
+@end deftypemethod
+
+@deftypemethod Config void readFile (@w{const char * @var{filename}})
+@deftypemethodx Config void readFile (@w{const std::string &@var{filename}})
+
+The @code{readFile()} method reads and parses a configuration from the
+file named @var{filename}. A @code{ParseException} is thrown if a
+parse error occurs. A @code{FileIOException} is thrown if the file
+cannot be read.
+
+@end deftypemethod
+
+@deftypemethod Config void writeFile (@w{const char * @var{filename}})
+@deftypemethodx Config void writeFile (@w{const std::string &@var{filename}})
+
+The @code{writeFile()} method writes the configuration to the file
+named @var{filename}. A @code{FileIOException} is thrown if the file cannot
+be written.
+
+@end deftypemethod
+
+@deftypemethod Config void readString (@w{const char * @var{str}})
+@deftypemethodx Config void readString (@w{const std::string &@var{str}})
+
+These methods read and parse a configuration from the string
+@var{str}. A @code{ParseException} is thrown if a parse error occurs.
+
+@end deftypemethod
+
+@deftypemethod ParseException {const char *} getError () const
+@deftypemethodx ParseException {const char *} getFile () const
+@deftypemethodx ParseException int getLine () const
+
+If a call to @code{readFile()}, @code{readString()}, or @code{read()}
+resulted in a @code{ParseException}, these methods can be called on
+the exception object to obtain the text, filename, and line number of
+the parse error. Storage for the strings returned by @code{getError()}
+and @code{getFile()} are managed by the library; the strings must not
+be freed by the caller.
+
+@end deftypemethod
+
+@deftypemethod Config void setIncludeDir (@w{const char *@var{includeDir}})
+@deftypemethodx Config {const char *} getIncludeDir () const
+
+The @code{setIncludeDir()} method specifies the include directory,
+@var{includeDir}, relative to which the files specified in
+@samp{@@include} directives will be located for the configuration. By
+default, there is no include directory, and all include files are
+expected to be relative to the current working directory. If
+@var{includeDir} is @code{NULL}, the default behavior is reinstated.
+
+For example, if the include directory is set to @file{/usr/local/etc},
+the include directive @samp{@@include "configs/extra.cfg"} would include the
+file @file{/usr/local/etc/configs/extra.cfg}.
+
+@code{getIncludeDir()} returns the current include directory for the
+configuration, or @code{NULL} if none is set.
+
+@end deftypemethod
+
+@deftypemethod Config {virtual const char **} evaluateIncludePath (@w{const char * @var{path}}, @w{const char ** @var{error}})
+
+@b{Since @i{v1.7}}
+
+This method is called to evaluate the path of an @code{@@include} directive.
+The @var{path} is the literal path argument of the directive. The method may
+be overridden in a subclass to perform tasks like wildcard expansion and
+variable substitution.
+
+On success, the method should return a @code{NULL}-terminated array of paths.
+Any relative paths must be relative to the program's current working directory.
+The contents of these files will be inlined at the point of inclusion, in the
+order that the paths appear in the array. Both the array and its elements should
+be heap allocated; the library will take ownership of and eventually free the
+strings in the array and the array itself.
+
+On failure, the function should return @code{NULL} and set @var{*error} to a
+static error string which should be used as the parse error for the
+configuration; the library does not take ownership of or free this string.
+
+The default implementation simply returns a @code{NULL}-terminated array
+containing either a copy of @var{path} if it's an absolute path, or a
+concatenation of the include directory and @var{path} if it's a relative path.
+
+For more information see @code{config_set_include_func()} above.
+
+@end deftypemethod
+
+@deftypemethod Config int getOptions () const
+@deftypemethodx Config void setOptions (int @var{options})
+
+@tindex Config::Option
+These methods get and set the options for the configuration. The
+options affect how configurations are read and written. The parameter
+@var{options} should be a bitwise-OR of the following @var{Config::Option}
+enumeration values:
+
+@table @code
+
+@item Config::OptionAutoConvert
+Turning this option on enables number auto-conversion for
+the configuration. When this feature is enabled, an attempt to retrieve a
+floating point setting's value into an integer (or vice versa), or
+store an integer to a floating point setting's value (or vice versa)
+will cause the library to silently perform the necessary conversion
+(possibly leading to loss of data), rather than reporting failure. By
+default this option is turned off.
+
+@item Config::OptionSemicolonSeparators
+This option controls whether a semicolon (`;') is output after each setting
+when the configuration is written to a file or stream. (The semicolon
+separators are optional in the configuration syntax.) By default this
+option is turned on.
+
+@item Config::OptionColonAssignmentForGroups
+This option controls whether a colon (`:') is output between each
+group setting's name and its value when the configuration is written to
+a file or stream. If the option is turned off, an equals sign (`=') is
+output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned on.
+
+@item Config::OptionColonAssignmentForNonGroups
+This option controls whether a colon (`:') is output between each
+non-group setting's name and its value when the configuration is written
+to a file or stream. If the option is turned off, an equals sign (`=')
+is output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned off.
+
+@item Config::OptionOpenBraceOnSeparateLine
+This option controls whether an open brace (`@{') will be written on its own
+line when the configuration is written to a file or stream. If the option is
+turned off, the brace will be written at the end of the previous line.
+By default this option is turned on.
+
+@item Config::OptionAllowScientificNotation
+(@b{Since @i{v1.7}})
+This option controls whether scientific notation may be used as appropriate
+when writing floating point values (corresponding to @code{printf()}
+@samp{%g} format) or should never be used (corresponding to @code{printf()}
+@samp{%f} format). By default this option is turned off.
+
+@item Config::OptionFsync
+(@b{Since @i{v1.7.1}})
+This option controls whether the @code{writeFile()} method performs an @i{fsync}
+operation after writing the configuration and before closing the file. By
+default this option is turned off.
+
+@item Config::OptionAllowOverrides
+(@b{Since @i{v1.7.3}})
+This option controls whether duplicate settings override previous settings
+with the same name. If this option is turned off, duplicate settings are
+rejected. By default this option is turned off.
+
+@end table
+
+@end deftypemethod
+
+@deftypemethod Config bool getOption (@w{Config::Option @var{option}}) const
+@deftypemethodx Config void setOption (@w{Config::Option @var{option}}, @w{bool @var{flag}})
+
+@b{Since @i{v1.7}}
+
+These methods get and set the option @var{option} for the configuration. The
+option is enabled if @var{flag} is @code{true} and disabled if it is
+@code{false}.
+
+See @code{setOptions()} above for the list of available options.
+
+@end deftypemethod
+
+@deftypemethod Config bool getAutoConvert () const
+@deftypemethodx Config void setAutoConvert (bool @var{flag})
+
+These methods get and set the @code{OptionAutoConvert} option. They
+are obsoleted by the @code{setOption()} and @code{getOption()}
+methods described above.
+
+@end deftypemethod
+
+@deftypemethod Config Setting::Format getDefaultFormat () const
+@deftypemethodx Config void setDefaultFormat (@w{Setting::Format @var{format}})
+
+These methods get and set the default external format for settings in
+the configuration. If a non-default format has not been set for a
+setting with @code{Setting::setFormat()}, this configuration-wide
+default format will be used instead when that setting is written to a
+file or stream.
+
+@end deftypemethod
+
+@deftypemethod Config {unsigned short} getTabWidth () const
+@deftypemethodx Config void setTabWidth (@w{unsigned short @var{width}})
+
+These methods get and set the tab width for the configuration. The tab
+width affects the formatting of the configuration when it is written
+to a file or stream: each level of nesting is indented by @var{width}
+spaces, or by a single tab character if @var{width} is 0. The tab
+width has no effect on parsing.
+
+Valid tab widths range from 0 to 15. The default tab width is 2.
+
+@end deftypemethod
+
+@deftypemethod Config {unsigned short} getFloatPrecision () const
+@deftypemethodx Config void setFloatPrecision (@w{unsigned short @var{width}})
+
+These methods get and set the float precision for the configuration.
+This parameter influences the formatting of floating point settings in
+the configuration when it is written to a file or stream.
+Float precision has no effect on parsing.
+
+Valid precisions range from 0 to about 15 (implementation dependent),
+though the library will accept and store values up to 255.
+
+@end deftypemethod
+
+@deftypemethod Config {Setting &} getRoot () const
+
+This method returns the root setting for the configuration, which is a group.
+
+@end deftypemethod
+
+@deftypemethod Config {Setting &} lookup (@w{const std::string &@var{path}}) const
+@deftypemethodx Config {Setting &} lookup (@w{const char * @var{path}}) const
+
+These methods locate the setting specified by the path @var{path}. If
+the requested setting is not found, a @code{SettingNotFoundException} is
+thrown.
+
+@end deftypemethod
+@deftypemethod Config bool exists (@w{const std::string &@var{path}}) const
+@deftypemethodx Config bool exists (@w{const char *@var{path}}) const
+
+These methods test if a setting with the given @var{path} exists in
+the configuration. They return @code{true} if the setting exists, and
+@code{false} otherwise. These methods do not throw exceptions.
+
+@end deftypemethod
+
+@deftypemethod Config bool lookupValue (@w{const char *@var{path}}, @w{bool &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{bool &@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{int &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{int &@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{unsigned int &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{unsigned int &@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{long long &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{long long &@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{float &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{float &@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{double &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{double &@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{const char *&@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{const char *&@var{value}}) const
+
+@deftypemethodx Config bool lookupValue (@w{const char *@var{path}}, @w{std::string &@var{value}}) const
+@deftypemethodx Config bool lookupValue (@w{const std::string &@var{path}}, @w{std::string &@var{value}}) const
+
+These are convenience methods for looking up the value of a setting
+with the given @var{path}. If the setting is found and is of an
+appropriate type, the value is stored in @var{value} and the method
+returns @code{true}. Otherwise, @var{value} is left unmodified and the
+method returns @code{false}. These methods do not throw exceptions.
+
+Storage for @w{@i{const char *}} values is managed by the library and
+released automatically when the setting is destroyed or when its value
+is changed; the string must not be freed by the caller. For safety and
+convenience, always assigning string values to a @code{std::string} is
+suggested.
+
+Since these methods have boolean return values and do not throw
+exceptions, they can be used within boolean logic expressions. The following
+example presents a concise way to look up three values at once and
+perform error handling if any of them are not found or are of the
+wrong type:
+
+@sp 1
+@cartouche
+@smallexample
+int var1;
+double var2;
+const char *var3;
+
+if(config.lookupValue("values.var1", var1)
+ && config.lookupValue("values.var2", var2)
+ && config.lookupValue("values.var3", var3))
+@{
+ // use var1, var2, var3
+@}
+else
+@{
+ // error handling here
+@}
+@end smallexample
+@end cartouche
+
+This approach also takes advantage of the short-circuit evaluation rules
+of C++, e.g., if the first lookup fails (returning @code{false}), the
+remaining lookups are skipped entirely.
+
+@end deftypemethod
+
+@deftypemethod Setting {} {operator bool ()} const
+@deftypemethodx Setting {} {operator int ()} const
+@deftypemethodx Setting {} {operator unsigned int ()} const
+@deftypemethodx Setting {} {operator long ()} const
+@deftypemethodx Setting {} {operator unsigned long ()} const
+@deftypemethodx Setting {} {operator long long ()} const
+@deftypemethodx Setting {} {operator unsigned long long ()} const
+@deftypemethodx Setting {} {operator float ()} const
+@deftypemethodx Setting {} {operator double ()} const
+@deftypemethodx Setting {} {operator const char * ()} const
+@deftypemethodx Setting {} {operator std::string ()} const
+@deftypemethodx Setting {const char *} c_str () const
+
+These cast operators allow a @code{Setting} object to be assigned to a
+variable of type @i{bool} if it is of type @code{TypeBoolean};
+@i{int}, @i{unsigned int}; @code{long long} or @code{unsigned long long} if
+it is of type @code{TypeInt64}, @i{float} or @i{double} if it is of type
+@code{TypeFloat}; or @w{@i{const char *}} or @i{std::string} if it is
+of type @code{TypeString}.
+
+Values of type @code{TypeInt} or @code{TypeInt64} may be assigned to
+variables of type @i{long}, or @i{unsigned long}, depending on the
+sizes of those types on the host system.
+
+Storage for @w{@i{const char *}} return values is managed by the
+library and released automatically when the setting is destroyed or
+when its value is changed; the string must not be freed by the
+caller. For safety and convenience, always assigning string return
+values to a @code{std::string} is suggested.
+
+The following examples demonstrate this usage:
+
+@cartouche
+@smallexample
+long width = config.lookup("application.window.size.w");
+
+bool splashScreen = config.lookup("application.splash_screen");
+
+std::string title = config.lookup("application.window.title");
+@end smallexample
+@end cartouche
+
+Note that certain conversions can lead to loss of precision or
+clipping of values, e.g., assigning a negative value to an @i{unsigned
+int} (in which case the value will be treated as 0), or a
+double-precision value to a @i{float}. The library does not treat
+these lossy conversions as errors.
+
+Perhaps surprisingly, the following code in particular will cause a
+compiler error:
+
+@cartouche
+@smallexample
+std::string title;
+.
+.
+.
+title = config.lookup("application.window.title");
+@end smallexample
+@end cartouche
+
+This is because the assignment operator of @code{std::string} is being
+invoked with a @code{Setting &} as an argument. The compiler is unable
+to make an implicit conversion because both the @code{const char *}
+and the @code{std::string} cast operators of @code{Setting} are
+equally appropriate. This is not a bug in @i{libconfig}; providing
+only the @code{const char *} cast operator would resolve this
+particular ambiguity, but would cause assignments to
+@code{std::string} like the one in the previous example to produce a
+compiler error. (To understand why, see section 11.4.1 of @i{The C++
+Programming Language}.)
+
+The solution to this problem is to use an explicit conversion that
+avoids the construction of an intermediate @code{std::string} object,
+as follows:
+
+@cartouche
+@smallexample
+std::string title;
+.
+.
+.
+title = (const char *)config.lookup("application.window.title");
+@end smallexample
+@end cartouche
+
+Or, alternatively, use the @code{c_str()} method, which has the same effect:
+
+@cartouche
+@smallexample
+std::string title;
+.
+.
+.
+title = config.lookup("application.window.title").c_str();
+@end smallexample
+@end cartouche
+
+If the assignment is invalid due to a type mismatch, a
+@code{SettingTypeException} is thrown.
+
+@end deftypemethod
+
+@deftypemethod Setting {Setting &} operator= (@w{bool @var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{int @var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{long @var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{const long long &@var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{float @var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{const double &@var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{const char *@var{value}})
+@deftypemethodx Setting {Setting &} operator= (@w{const std::string &@var{value}})
+
+These assignment operators allow values of type @i{bool}, @i{int},
+@i{long}, @i{long long}, @i{float}, @i{double}, @i{const char *}, and
+@i{std::string} to be assigned to a setting. In the case of strings,
+the library makes a copy of the passed string @var{value}, so it may
+be subsequently freed or modified by the caller without affecting the
+value of the setting.
+
+The following example code looks up a (presumably) integer setting
+and changes its value:
+
+@cartouche
+@smallexample
+Setting &setting = config.lookup("application.window.size.w");
+setting = 1024;
+@end smallexample
+@end cartouche
+
+If the assignment is invalid due to a type mismatch, a
+@code{SettingTypeException} is thrown.
+
+@end deftypemethod
+
+@deftypemethod Setting {Setting &} {operator[]} (@w{int @var{index}}) const
+@deftypemethodx Setting {Setting &} {operator[]} (@w{const std::string &@var{name}}) const
+@deftypemethodx Setting {Setting &} {operator[]} (@w{const char *@var{name}}) const
+
+A @code{Setting} object may be subscripted with an integer index
+@var{index} if it is an array or list, or with either a string
+@var{name} or an integer index @var{index} if it is a group. For example,
+the following code would produce the string @samp{Last Name} when
+applied to the example configuration in @ref{Configuration Files}.
+
+@cartouche
+@smallexample
+Setting& setting = config.lookup("application.misc");
+const char *s = setting["columns"][0];
+@end smallexample
+@end cartouche
+
+If the setting is not an array, list, or group, a
+@code{SettingTypeException} is thrown. If the subscript (@var{index}
+or @var{name}) does not refer to a valid element, a
+@code{SettingNotFoundException} is thrown.
+
+Iterating over a group's child settings with an integer index will
+return the settings in the same order that they appear in the
+configuration.
+
+@end deftypemethod
+
+@deftypemethod Setting {Setting &} lookup (@w{const char * @var{path}}) const
+@deftypemethodx Setting {Setting &} lookup (@w{const std::string &@var{path}}) const
+
+These methods locate a setting by a path @var{path} relative to
+this setting. If requested setting is not found, a
+@code{SettingNotFoundException} is thrown.
+
+@end deftypemethod
+
+@deftypemethod Setting bool lookupValue (@w{const char *@var{name}}, @w{bool &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{bool &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{int &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{int &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{unsigned int &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{unsigned int &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{long long &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{long long &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{unsigned long long &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{unsigned long long &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{float &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{float &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{double &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{double &@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{const char *&@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{const char *&@var{value}}) const
+
+@deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{std::string &@var{value}}) const
+@deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{std::string &@var{value}}) const
+
+These are convenience methods for looking up the value of a child setting
+with the given @var{name}. If the setting is found and is of an
+appropriate type, the value is stored in @var{value} and the method
+returns @code{true}. Otherwise, @var{value} is left unmodified and the
+method returns @code{false}. These methods do not throw exceptions.
+
+Storage for @w{@i{const char *}} values is managed by the library and
+released automatically when the setting is destroyed or when its value
+is changed; the string must not be freed by the caller. For safety and
+convenience, always assigning string values to a @code{std::string} is
+suggested.
+
+Since these methods have boolean return values and do not throw
+exceptions, they can be used within boolean logic expressions. The following
+example presents a concise way to look up three values at once and
+perform error handling if any of them are not found or are of the
+wrong type:
+
+@sp 1
+@cartouche
+@smallexample
+int var1;
+double var2;
+const char *var3;
+
+if(setting.lookupValue("var1", var1)
+ && setting.lookupValue("var2", var2)
+ && setting.lookupValue("var3", var3))
+@{
+ // use var1, var2, var3
+@}
+else
+@{
+ // error handling here
+@}
+@end smallexample
+@end cartouche
+
+This approach also takes advantage of the short-circuit evaluation
+rules of C++, e.g., if the first lookup fails (returning @code{false}), the
+remaining lookups are skipped entirely.
+
+@end deftypemethod
+
+@deftypemethod Setting {Setting &} add (@w{const std::string &@var{name}}, @w{Setting::Type @var{type}})
+@deftypemethodx Setting {Setting &} add (@w{const char *@var{name}}, @w{Setting::Type @var{type}})
+
+These methods add a new child setting with the given @var{name} and
+@var{type} to the setting, which must be a group. They return a
+reference to the new setting. If the setting already has a child
+setting with the given name, or if the name is invalid, a
+@code{SettingNameException} is thrown. If the setting is not a group,
+a @code{SettingTypeException} is thrown.
+
+Once a setting has been created, neither its name nor type can be
+changed.
+
+@end deftypemethod
+
+@deftypemethod Setting {Setting &} add (@w{Setting::Type @var{type}})
+
+This method adds a new element to the setting, which must be of type
+@code{TypeArray} or @code{TypeList}. If the setting is an array which
+currently has zero elements, the @var{type} parameter (which must be
+@code{TypeInt}, @code{TypeInt64}, @code{TypeFloat}, @code{TypeBool},
+or @code{TypeString}) determines the type for the array; otherwise it
+must match the type of the existing elements in the array.
+
+The method returns the new setting on success. If @var{type} is a
+scalar type, the new setting will have a default value of 0, 0.0,
+@code{false}, or @code{NULL}, as appropriate.
+
+The method throws a @code{SettingTypeException} if the setting is not
+an array or list, or if @var{type} is invalid.
+
+@end deftypemethod
+
+@deftypemethod Setting void remove (@w{const std::string &@var{name}})
+@deftypemethodx Setting void remove (@w{const char *@var{name}})
+
+These methods remove the child setting with the given @var{name} from
+the setting, which must be a group. Any child settings of the removed
+setting are recursively destroyed as well.
+
+If the setting is not a group, a @code{SettingTypeException} is
+thrown. If the setting does not have a child setting with the given
+name, a @code{SettingNotFoundException} is thrown.
+
+@end deftypemethod
+
+@deftypemethod Setting void remove (@w{unsigned int @var{index}})
+
+This method removes the child setting at the given index @var{index} from
+the setting, which must be a group, list, or array. Any child settings
+of the removed setting are recursively destroyed as well.
+
+If the setting is not a group, list, or array, a
+@code{SettingTypeException} is thrown. If @var{index} is out of range,
+a @code{SettingNotFoundException} is thrown.
+
+@end deftypemethod
+
+@deftypemethod Setting {const char *} getName () const
+
+This method returns the name of the setting, or @code{NULL} if the
+setting has no name. Storage for the returned string is managed by the
+library and released automatically when the setting is destroyed; the
+string must not be freed by the caller. For safety and convenience,
+consider assigning the return value to a @code{std::string}.
+
+@end deftypemethod
+
+@deftypemethod Setting {std::string} getPath () const
+
+This method returns the complete dot-separated path to the
+setting. Settings which do not have a name (list and array elements)
+are represented by their index in square brackets.
+
+@end deftypemethod
+
+@deftypemethod Setting {Setting &} getParent () const
+
+This method returns the parent setting of the setting. If the setting
+is the root setting, a @code{SettingNotFoundException} is thrown.
+
+@end deftypemethod
+
+@deftypemethod Setting bool isRoot () const
+
+This method returns @code{true} if the setting is the root setting, and
+@code{false} otherwise.
+
+@end deftypemethod
+
+@deftypemethod Setting int getIndex () const
+
+This method returns the index of the setting within its parent
+setting. When applied to the root setting, this method returns -1.
+
+@end deftypemethod
+
+@deftypemethod Setting Setting::Type getType () const
+
+@tindex Setting::Type
+This method returns the type of the setting. The
+@code{Setting::Type} enumeration consists of the following constants:
+@code{TypeInt}, @code{TypeInt64}, @code{TypeFloat}, @code{TypeString},
+@code{TypeBoolean}, @code{TypeArray}, @code{TypeList}, and
+@code{TypeGroup}.
+
+@end deftypemethod
+
+@deftypemethod Setting Setting::Format getFormat () const
+@deftypemethodx Setting void setFormat (@w{Setting::Format @var{format}})
+
+These methods get and set the external format for the setting.
+
+@tindex Setting::Format
+The @var{Setting::Format} enumeration consists of the following
+constants: @code{FormatDefault} and @code{FormatHex}. All settings
+support the @code{FormatDefault} format. The @code{FormatHex} format
+specifies hexadecimal formatting for integer values, and hence only
+applies to settings of type @code{TypeInt} and @code{TypeInt64}. If
+@var{format} is invalid for the given setting, it is ignored.
+
+@end deftypemethod
+
+@deftypemethod Setting bool exists (@w{const std::string &@var{name}}) const
+@deftypemethodx Setting bool exists (@w{const char *@var{name}}) const
+
+These methods test if the setting has a child setting with the given
+@var{name}. They return @code{true} if the setting exists, and
+@code{false} otherwise. These methods do not throw exceptions.
+
+@end deftypemethod
+@page
+@deftypemethod Setting iterator begin ()
+@deftypemethodx Setting iterator end ()
+@deftypemethodx Setting const_iterator begin ()
+@deftypemethodx Setting const_iterator end ()
+
+These methods return STL-style iterators that can be used to enumerate
+the child settings of a given setting. If the setting is not an array, list,
+or group, they throw a @code{SettingTypeException}.
+
+@end deftypemethod
+
+@deftypemethod Setting int getLength () const
+
+This method returns the number of settings in a group, or the number of
+elements in a list or array. For other types of settings, it returns
+0.
+
+@end deftypemethod
+
+@deftypemethod Setting bool isGroup () const
+@deftypemethodx Setting bool isArray () const
+@deftypemethodx Setting bool isList () const
+
+These convenience methods test if a setting is of a given type.
+
+@end deftypemethod
+
+@deftypemethod Setting bool isAggregate () const
+@deftypemethodx Setting bool isScalar () const
+@deftypemethodx Setting bool isNumber () const
+@deftypemethodx Setting bool isString () const
+
+These convenience methods test if a setting is of an aggregate type (a
+group, array, or list), of a scalar type (integer, 64-bit integer,
+floating point, boolean, or string), of a number (integer, 64-bit
+integer, or floating point), and of a string respectively.
+
+@end deftypemethod
+
+@deftypemethod Setting {const char *} getSourceFile () const
+
+This method returns the name of the file from which the setting was
+read, or NULL if the setting was not read from a file. This
+information is useful for reporting application-level errors. Storage
+for the returned string is managed by the library and released
+automatically when the configuration is destroyed; the string must
+not be freed by the caller.
+
+@end deftypemethod
+
+@deftypemethod Setting {unsigned int} getSourceLine () const
+
+This method returns the line number of the configuration file or
+stream at which the setting @var{setting} was read, or 0 if no line
+number is available. This information is useful for reporting
+application-level errors.
+
+@end deftypemethod
+
+@node Example Programs, Other Bindings and Implementations, The C++ API, Top
+@comment node-name, next, previous, up
+@chapter Example Programs
+
+Practical example programs that illustrate how to use @i{libconfig}
+from both C and C++ are included in the @file{examples} subdirectory
+of the distribution. These examples include:
+
+@table @file
+
+@item examples/c/example1.c
+An example C program that reads a configuration from an existing file
+@file{example.cfg} (also located in @file{examples/c}) and displays
+some of its contents.
+
+@item examples/c++/example1.cpp
+The C++ equivalent of @file{example1.c}.
+
+@item examples/c/example2.c
+An example C program that reads a configuration from an existing file
+@file{example.cfg} (also located in @file{examples/c}), adds new
+settings to the configuration, and writes the updated configuration to
+another file.
+
+@item examples/c++/example2.cpp
+The C++ equivalent of @file{example2.c}
+
+@item examples/c/example3.c
+An example C program that constructs a new configuration in memory and writes it to a file.
+
+@item examples/c++/example3.cpp
+The C++ equivalent of @file{example3.c}
+
+@item examples/c/example4.c
+An example C program that uses a custom include function for processing
+wildcard includes. Note that this code will not compile on Windows.
+
+@end table
+
+@node Other Bindings and Implementations, License, Example Programs, Top
+@comment node-name, next, previous, up
+@chapter Other Bindings and Implementations
+@menu
+* Bourne Shell::
+* D::
+* Haskell::
+* Java::
+* Lisp::
+* Perl::
+* Python::
+* Ruby::
+@end menu
+
+Various open-source libraries have been written that provide access to
+@i{libconfig}-style configuration files from other programming languages. Some
+of these libraries are wrappers which add new language bindings for
+@i{libconfig} while others are syntax-compatible reimplementations in other
+languages.
+
+Here is a list of some of these implementations.
+
+@node Bourne Shell, D, , Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Bourne Shell
+
+@L{}ukasz A. Grabowski's @i{ls-config} provides a means to read and write
+values in @i{libconfig} configuration files from Bourne shell scripts. The
+implementation is included in the @i{libconfig} git repository at
+@url{https://github.com/hyperrealm/libconfig}, in the @file{contrib/ls-config}
+subdirectory.
+
+@node D, Haskell, Bourne Shell, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section D
+
+Remi Thebault's @i{libconfig-d} is a port of @i{libconfig} to the D programming
+language. It may be found at @url{https://code.dlang.org/packages/libconfig-d}.
+
+@node Haskell, Java, D, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Haskell
+
+Matthew Peddie's @i{libconfig} provides Haskell bindings to
+@i{libconfig}. It may be found at
+@url{https://hackage.haskell.org/package/libconfig-0.3.0.0}.
+
+@node Java, Lisp, Haskell, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Java
+
+Andrey V. Pleskach has a pure-Java implementation of @i{libconfig}. It may be
+found on github at @url{https://github.com/willyborankin/libconfig}.
+
+@node Lisp, Perl, Java, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Lisp
+
+Oleg Shalaev's @i{cl-libconfig} provides Common Lisp bindings for @i{libconfig}.
+It may be found on github at @url{https://github.com/chalaev/cl-libconfig}.
+
+@node Perl, Python, Lisp, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Perl
+
+The @i{Conf::Libconfig} module provides Perl bindings for @i{libconfig}. It may
+be found on CPAN at @url{http://search.cpan.org/~cnangel/Conf-Libconfig-0.05/}
+or on github at @url{https://github.com/cnangel/Conf-Libconfig}.
+
+@node Python, Ruby, Perl, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Python
+
+Heiner Tholen's @i{pylibconfig2} is a Python library that is syntax-compatible
+with @i{libconfig}. It may be found at
+@url{https://pypi.python.org/pypi/pylibconfig2/0.1.2}.
+
+@sp 1
+
+Christian Aichinger's @i{libconf} is another pure-Python implementation with a
+more permissive license. It may be found at
+@url{https://pypi.python.org/pypi/libconf} or on github at
+@url{https://github.com/Grk0/python-libconf}.
+
+@sp 1
+
+The @i{python-libconfig} wrapper provides Python bindings to @i{libconfig}. It
+may be found on github at @url{https://github.com/cnangel/python-libconfig/}.
+
+@node Ruby, , Python, Other Bindings and Implementations
+@comment node-name, next, previous, up
+@section Ruby
+
+Christopher Mark Gore's @i{ruby-libconfig} is a Ruby library that provides Ruby
+bindings for @i{libconfig}. It may be found at
+@url{https://rubygems.org/gems/libconfig} or on github at
+@url{https://github.com/cgore/ruby-libconfig}.
+
+@sp 1
+
+There is also another Ruby wrapper, @i{libconfig-ruby}, that is included in
+the @i{libconfig} git repository at @url{https://github.com/hyperrealm/libconfig},
+in the @file{contrib/libconfig-ruby} subdirectory.
+
+@node License, Configuration File Grammar, Other Bindings and Implementations, Top
+@comment node-name, next, previous, up
+@appendix License
+
+@include LGPL.texi
+
+@node Configuration File Grammar, Function Index, License, Top
+@comment node-name, next, previous, up
+@appendix Configuration File Grammar
+
+Below is the BNF grammar for configuration files. Comments and include
+directives are not part of the grammar, so they are not included here.
+
+@sp 1
+@example
+<configuration> ::=
+ <setting-list>
+ | <empty>
+
+<setting-list> ::=
+ <setting>
+ | <setting-list> <setting>
+
+<setting> ::=
+ <name> ( ":" | "=" ) <value> ( ";" | "," | <empty> )
+
+<value> ::=
+ <scalar-value>
+ | <array>
+ | <list>
+ | <group>
+
+<value-list> ::=
+ <value>
+ | <value-list> "," <value>
+ | <value-list> ","
+
+<scalar-value> ::=
+ <boolean>
+ | <integer>
+ | <integer64>
+ | <hex>
+ | <hex64>
+ | <float>
+ | <string>
+
+<scalar-value-list> ::=
+ <scalar-value>
+ | <scalar-value-list> "," <scalar-value>
+ | <scalar-value-list> ","
+
+<array> ::=
+ "[" ( <scalar-value-list> | <empty> ) "]"
+
+<list> ::=
+ "(" ( <value-list> | <empty> ) ")"
+
+<group> ::=
+ "@{" ( <setting-list> | <empty> ) "@}"
+
+<empty> ::=
+@end example
+
+@sp 2
+Terminals are defined below as regular expressions:
+@sp 1
+
+@multitable @columnfractions .2 .8
+@item @code{<boolean>} @tab
+@code{([Tt][Rr][Uu][Ee])|([Ff][Aa][Ll][Ss][Ee])}
+@item @code{<string>} @tab
+@code{\"([^\"\\]|\\.)*\"}
+@item @code{<name>} @tab
+@code{[A-Za-z\*][-A-Za-z0-9_\*]*}
+@item @code{<integer>} @tab
+@code{[-+]?[0-9]+}
+@item @code{<integer64>} @tab
+@code{[-+]?[0-9]+L(L)?}
+@item @code{<hex>} @tab
+@code{0[Xx][0-9A-Fa-f]+}
+@item @code{<hex64>} @tab
+@code{0[Xx][0-9A-Fa-f]+(L(L)?)?}
+@item @code{<float>} @tab
+@code{([-+]?([0-9]*)?\.[0-9]*([eE][-+]?[0-9]+)?)|([-+]([0-9]+)(\.[0-9]*)?[eE][-+]?[0-9]+)}
+@end multitable
+
+@sp 1
+
+Note that adjacent strings are automatically concatenated. Non-printable
+characters can be represented within strings using a sequence @samp{\xx},
+representing the ASCII value as two hex digits.
+
+@node Function Index, Type Index, Configuration File Grammar, Top
+@comment node-name, next, previous, up
+@unnumbered Function Index
+
+@printindex fn
+
+@node Type Index, Concept Index, Function Index, Top
+@comment node-name, next, previous, up
+@unnumbered Type Index
+
+@printindex tp
+
+@node Concept Index, , Type Index, Top
+@comment node-name, next, previous, up
+@unnumbered Concept Index
+
+@printindex cp
+
+@bye
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 0000000..c419263
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-cayman \ No newline at end of file
diff --git a/docs/dist/libconfig-1.7.1.tar.gz b/docs/dist/libconfig-1.7.1.tar.gz
new file mode 100644
index 0000000..3fb7596
--- /dev/null
+++ b/docs/dist/libconfig-1.7.1.tar.gz
Binary files differ
diff --git a/docs/dist/libconfig-1.7.2.tar.gz b/docs/dist/libconfig-1.7.2.tar.gz
new file mode 100644
index 0000000..7baedb9
--- /dev/null
+++ b/docs/dist/libconfig-1.7.2.tar.gz
Binary files differ
diff --git a/docs/dist/libconfig-1.7.tar.gz b/docs/dist/libconfig-1.7.tar.gz
new file mode 100644
index 0000000..dcb59d1
--- /dev/null
+++ b/docs/dist/libconfig-1.7.tar.gz
Binary files differ
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..f40cc0c
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,41 @@
+## About
+
+*Libconfig* is a simple library for processing structured configuration
+files, like [this one](test.cfg.txt). This file format is more compact
+and more readable than XML. And unlike XML, it is type-aware, so it is
+not necessary to do string parsing in application code.
+
+*Libconfig* is very compact -- a fraction of the size of the _expat_ XML
+parser library. This makes it well-suited for memory-constrained systems
+like handheld devices.
+
+The library includes bindings for both the C and C++ languages. It works
+on POSIX-compliant UNIX and UNIX-like systems (GNU/Linux, Mac OS X,
+FreeBSD), Android, and Windows (2000, XP and later).
+
+## Documentation
+
+Documentation is included in the distribution
+in the form of a _texinfo_ manual. The documentation is
+also available in the following formats:
+
+- [HTML](libconfig_manual.html)
+- [PDF](libconfig_manual.pdf)
+
+## License
+
+*Libconfig* is distributed under the terms of the [GNU Lesser General
+Public License](http://www.gnu.org/licenses/lgpl.html). This license was
+chosen over the standard GNU license to allow *libconfig* to be used
+with non-free programs.
+
+## Downloads
+
+Download *libconfig* now! Source code and full documentation are
+included. Windows users may build the package using either gcc in the
+MinGW environment or with Visual Studio 2008 or later using the provided
+solution file.
+
+<center>
+<a href="dist/libconfig-1.7.2.tar.gz"><b>libconfig-1.7.2.tar.gz</b></a>
+</center>
diff --git a/docs/libconfig_manual.html b/docs/libconfig_manual.html
new file mode 100644
index 0000000..2b5da07
--- /dev/null
+++ b/docs/libconfig_manual.html
@@ -0,0 +1,3810 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
+<head>
+<title>libconfig</title>
+
+<meta name="description" content="libconfig">
+<meta name="keywords" content="libconfig">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="makeinfo">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link href="#Top" rel="start" title="Top">
+<link href="#Function-Index" rel="index" title="Function Index">
+<link href="#SEC_Contents" rel="contents" title="Table of Contents">
+<link href="dir.html#Top" rel="up" title="(dir)">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smalllisp {margin-left: 3.2em}
+kbd {font-style: oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: inherit; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: inherit; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: initial; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<h1 class="settitle" align="center">libconfig</h1>
+
+
+
+
+
+
+
+
+
+<hr noshade size=6 color="black">
+<div align=right>A Library For Processing Structured Configuration Files<br>
+Version 1.7.2<br>
+5 Jan 2018</div>
+<br><br><br><br>
+<font size=+1>Mark A. Lindner</font>
+<hr size=3 noshade color="black">
+<br><br>
+
+<a name="SEC_Contents"></a>
+<h2 class="contents-heading">Table of Contents</h2>
+
+<div class="contents">
+
+<ul class="no-bullet">
+ <li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a>
+ <ul class="no-bullet">
+ <li><a name="toc-Why-Another-Configuration-File-Library_003f-1" href="#Why-Another-Configuration-File-Library_003f">1.1 Why Another Configuration File Library?</a></li>
+ <li><a name="toc-Using-the-Library-from-a-C-Program-1" href="#Using-the-Library-from-a-C-Program">1.2 Using the Library from a C Program</a></li>
+ <li><a name="toc-Using-the-Library-from-a-C_002b_002b-Program-1" href="#Using-the-Library-from-a-C_002b_002b-Program">1.3 Using the Library from a C++ Program</a></li>
+ <li><a name="toc-Multithreading-Issues-1" href="#Multithreading-Issues">1.4 Multithreading Issues</a></li>
+ <li><a name="toc-Internationalization-Issues-1" href="#Internationalization-Issues">1.5 Internationalization Issues</a></li>
+ <li><a name="toc-Compiling-Using-pkg_002dconfig-1" href="#Compiling-Using-pkg_002dconfig">1.6 Compiling Using pkg-config</a></li>
+ <li><a name="toc-Version-Test-Macros-1" href="#Version-Test-Macros">1.7 Version Test Macros</a></li>
+ </ul></li>
+ <li><a name="toc-Configuration-Files-1" href="#Configuration-Files">2 Configuration Files</a>
+ <ul class="no-bullet">
+ <li><a name="toc-Settings-1" href="#Settings">2.1 Settings</a></li>
+ <li><a name="toc-Groups-1" href="#Groups">2.2 Groups</a></li>
+ <li><a name="toc-Arrays-1" href="#Arrays">2.3 Arrays</a></li>
+ <li><a name="toc-Lists-1" href="#Lists">2.4 Lists</a></li>
+ <li><a name="toc-Integer-Values-1" href="#Integer-Values">2.5 Integer Values</a></li>
+ <li><a name="toc-64_002dbit-Integer-Values-1" href="#g_t64_002dbit-Integer-Values">2.6 64-bit Integer Values</a></li>
+ <li><a name="toc-Floating-Point-Values-1" href="#Floating-Point-Values">2.7 Floating Point Values</a></li>
+ <li><a name="toc-Boolean-Values-1" href="#Boolean-Values">2.8 Boolean Values</a></li>
+ <li><a name="toc-String-Values-1" href="#String-Values">2.9 String Values</a></li>
+ <li><a name="toc-Comments-1" href="#Comments">2.10 Comments</a></li>
+ <li><a name="toc-Include-Directives-1" href="#Include-Directives">2.11 Include Directives</a></li>
+ </ul></li>
+ <li><a name="toc-The-C-API-1" href="#The-C-API">3 The C API</a></li>
+ <li><a name="toc-The-C_002b_002b-API-1" href="#The-C_002b_002b-API">4 The C++ API</a></li>
+ <li><a name="toc-Example-Programs-1" href="#Example-Programs">5 Example Programs</a></li>
+ <li><a name="toc-Other-Bindings-and-Implementations-1" href="#Other-Bindings-and-Implementations">6 Other Bindings and Implementations</a>
+ <ul class="no-bullet">
+ <li><a name="toc-Bourne-Shell-1" href="#Bourne-Shell">6.1 Bourne Shell</a></li>
+ <li><a name="toc-D-1" href="#D">6.2 D</a></li>
+ <li><a name="toc-Haskell-1" href="#Haskell">6.3 Haskell</a></li>
+ <li><a name="toc-Java-1" href="#Java">6.4 Java</a></li>
+ <li><a name="toc-Lisp-1" href="#Lisp">6.5 Lisp</a></li>
+ <li><a name="toc-Perl-1" href="#Perl">6.6 Perl</a></li>
+ <li><a name="toc-Python-1" href="#Python">6.7 Python</a></li>
+ <li><a name="toc-Ruby-1" href="#Ruby">6.8 Ruby</a></li>
+ </ul></li>
+ <li><a name="toc-License-1" href="#License">Appendix A License</a></li>
+ <li><a name="toc-Configuration-File-Grammar-1" href="#Configuration-File-Grammar">Appendix B Configuration File Grammar</a></li>
+ <li><a name="toc-Function-Index-1" href="#Function-Index">Function Index</a></li>
+ <li><a name="toc-Type-Index-1" href="#Type-Index">Type Index</a></li>
+ <li><a name="toc-Concept-Index-1" href="#Concept-Index">Concept Index</a></li>
+</ul>
+</div>
+
+
+<a name="Top"></a>
+<div class="header">
+<p>
+Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="libconfig"></a>
+<h1 class="top">libconfig</h1>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Configuration-Files" accesskey="2">Configuration Files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-C-API" accesskey="3">The C API</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#The-C_002b_002b-API" accesskey="4">The C++ API</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Example-Programs" accesskey="5">Example Programs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Other-Bindings-and-Implementations" accesskey="6">Other Bindings and Implementations</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#License" accesskey="7">License</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Configuration-File-Grammar" accesskey="8">Configuration File Grammar</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Function-Index" accesskey="9">Function Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Type-Index">Type Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Concept-Index">Concept Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+
+<hr>
+<a name="Introduction"></a>
+<div class="header">
+<p>
+Next: <a href="#Configuration-Files" accesskey="n" rel="next">Configuration Files</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Why-Another-Configuration-File-Library_003f" accesskey="1">Why Another Configuration File Library?</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Using-the-Library-from-a-C-Program" accesskey="2">Using the Library from a C Program</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Using-the-Library-from-a-C_002b_002b-Program" accesskey="3">Using the Library from a C++ Program</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Multithreading-Issues" accesskey="4">Multithreading Issues</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Internationalization-Issues" accesskey="5">Internationalization Issues</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Compiling-Using-pkg_002dconfig" accesskey="6">Compiling Using pkg-config</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Version-Test-Macros" accesskey="7">Version Test Macros</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+<a name="Introduction-1"></a>
+<h2 class="chapter">1 Introduction</h2>
+
+<p><i>Libconfig</i> is a library for reading, manipulating, and writing
+structured configuration files. The library features a fully
+reentrant parser and includes bindings for both the C and C++
+programming languages.
+</p>
+<p>The library runs on modern POSIX-compilant systems, such as Linux,
+Solaris, and Mac OS X (Darwin), as well as on Microsoft Windows
+2000/XP and later (with either Microsoft Visual Studio 2005 or later,
+or the GNU toolchain via the MinGW environment).
+</p>
+<hr>
+<a name="Why-Another-Configuration-File-Library_003f"></a>
+<div class="header">
+<p>
+Next: <a href="#Using-the-Library-from-a-C-Program" accesskey="n" rel="next">Using the Library from a C Program</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Why-Another-Configuration-File-Library_003f-1"></a>
+<h3 class="section">1.1 Why Another Configuration File Library?</h3>
+
+<p>There are several open-source configuration file libraries available
+as of this writing. This library was written because each of those
+libraries falls short in one or more ways. The main features of
+<i>libconfig</i> that set it apart from the other libraries are:
+</p>
+<ul>
+<li> A fully reentrant parser. Independent configurations can be parsed in concurrent threads at the same time.
+
+</li><li> Both C <i>and</i> C++ bindings, as well as hooks to allow for the creation of wrappers in other languages.
+
+</li><li> A simple, structured configuration file format that is more
+readable and compact than XML and more flexible than the obsolete but
+prevalent Windows &ldquo;INI&rdquo; file format.
+
+</li><li> A low-footprint implementation (just 37K for the C library and 76K for
+the C++ library) that is suitable for memory-constrained systems.
+
+</li><li> Proper documentation.
+
+</li></ul>
+
+<hr>
+<a name="Using-the-Library-from-a-C-Program"></a>
+<div class="header">
+<p>
+Next: <a href="#Using-the-Library-from-a-C_002b_002b-Program" accesskey="n" rel="next">Using the Library from a C++ Program</a>, Previous: <a href="#Why-Another-Configuration-File-Library_003f" accesskey="p" rel="prev">Why Another Configuration File Library?</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Using-the-Library-from-a-C-Program-1"></a>
+<h3 class="section">1.2 Using the Library from a C Program</h3>
+
+<p>To use the library from C code, include the following preprocessor
+directive in your source files:
+</p>
+<br>
+<div class="smallexample">
+<pre class="smallexample">#include &lt;libconfig.h&gt;
+</pre></div>
+<br>
+
+<p>To link with the library, specify &lsquo;<samp>-lconfig</samp>&rsquo; as an argument to the
+linker.
+</p>
+<hr>
+<a name="Using-the-Library-from-a-C_002b_002b-Program"></a>
+<div class="header">
+<p>
+Next: <a href="#Multithreading-Issues" accesskey="n" rel="next">Multithreading Issues</a>, Previous: <a href="#Using-the-Library-from-a-C-Program" accesskey="p" rel="prev">Using the Library from a C Program</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Using-the-Library-from-a-C_002b_002b-Program-1"></a>
+<h3 class="section">1.3 Using the Library from a C++ Program</h3>
+
+<p>To use the library from C++, include the following preprocessor
+directive in your source files:
+</p>
+<br>
+<div class="smallexample">
+<pre class="smallexample">#include &lt;libconfig.h++&gt;
+</pre></div>
+<br>
+
+<p>Or, alternatively:
+</p>
+<br>
+<div class="smallexample">
+<pre class="smallexample">#include &lt;libconfig.hh&gt;
+</pre></div>
+<br>
+<p>The C++ API classes are defined in the namespace &lsquo;<samp>libconfig</samp>&rsquo;, hence the
+following statement may optionally be used:
+</p>
+<br>
+<div class="smallexample">
+<pre class="smallexample">using namespace libconfig;
+</pre></div>
+<br>
+
+<p>To link with the library, specify &lsquo;<samp>-lconfig++</samp>&rsquo; as an argument to
+the linker.
+</p>
+<hr>
+<a name="Multithreading-Issues"></a>
+<div class="header">
+<p>
+Next: <a href="#Internationalization-Issues" accesskey="n" rel="next">Internationalization Issues</a>, Previous: <a href="#Using-the-Library-from-a-C_002b_002b-Program" accesskey="p" rel="prev">Using the Library from a C++ Program</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Multithreading-Issues-1"></a>
+<h3 class="section">1.4 Multithreading Issues</h3>
+
+<p><i>Libconfig</i> is fully <em>reentrant</em>; the functions in the library
+do not make use of global variables and do not maintain state between
+successive calls. Therefore two independent configurations may be safely
+manipulated concurrently by two distinct threads.
+</p>
+<p><i>Libconfig</i> is not <em>thread-safe</em>. The library is not aware of
+the presence of threads and knows nothing about the host system&rsquo;s
+threading model. Therefore, if an instance of a configuration is to be
+accessed from multiple threads, it must be suitably protected by
+synchronization mechanisms like read-write locks or mutexes; the
+standard rules for safe multithreaded access to shared data must be
+observed.
+</p>
+<p><i>Libconfig</i> is not <em>async-safe</em>. Calls should not be made into
+the library from signal handlers, because some of the C library
+routines that it uses may not be async-safe.
+</p>
+<p><i>Libconfig</i> is not guaranteed to be <em>cancel-safe</em>. Since it is
+not aware of the host system&rsquo;s threading model, the library does not
+contain any thread cancellation points. In most cases this will not be
+an issue for multithreaded programs. However, be aware that some of
+the routines in the library (namely those that read/write
+configurations from/to files or streams) perform I/O using C library
+routines which may potentially block; whether or not these C library
+routines are cancel-safe depends on the host system.
+</p>
+<hr>
+<a name="Internationalization-Issues"></a>
+<div class="header">
+<p>
+Next: <a href="#Compiling-Using-pkg_002dconfig" accesskey="n" rel="next">Compiling Using pkg-config</a>, Previous: <a href="#Multithreading-Issues" accesskey="p" rel="prev">Multithreading Issues</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Internationalization-Issues-1"></a>
+<h3 class="section">1.5 Internationalization Issues</h3>
+
+<a name="index-Unicode"></a>
+<a name="index-UTF_002d8"></a>
+<p><i>Libconfig</i> does not natively support Unicode configuration files,
+but string values may contain Unicode text encoded in UTF-8; such
+strings will be treated as ordinary 8-bit ASCII text by the
+library. It is the responsibility of the calling program to perform
+the necessary conversions to/from wide (<tt>wchar_t</tt>) strings using the
+wide string conversion functions such as <tt>mbsrtowcs()</tt> and
+<tt>wcsrtombs()</tt> or the <tt>iconv()</tt> function of the <i>libiconv</i>
+library.
+</p>
+<a name="index-locale"></a>
+<p>The textual representation of a floating point value varies by
+locale. However, the <i>libconfig</i> grammar specifies that
+floating point values are represented using a period (&lsquo;.&rsquo;) as the
+radix symbol; this is consistent with the grammar of most programming
+languages. When a configuration is read in or written out,
+<i>libconfig</i> temporarily changes the <tt>LC_NUMERIC</tt> category of the
+locale of the calling thread to the &ldquo;C&rdquo; locale to ensure consistent
+handling of floating point values regardless of the locale(s) in use
+by the calling program.
+</p>
+<p>Note that the MinGW environment does not (as of this writing) provide
+functions for changing the locale of the calling thread. Therefore,
+when using <i>libconfig</i> in that environment, the calling program is
+responsible for changing the <tt>LC_NUMERIC</tt> category of the locale to
+the &quot;C&quot; locale before reading or writing a configuration.
+</p>
+<hr>
+<a name="Compiling-Using-pkg_002dconfig"></a>
+<div class="header">
+<p>
+Next: <a href="#Version-Test-Macros" accesskey="n" rel="next">Version Test Macros</a>, Previous: <a href="#Internationalization-Issues" accesskey="p" rel="prev">Internationalization Issues</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Compiling-Using-pkg_002dconfig-1"></a>
+<h3 class="section">1.6 Compiling Using pkg-config</h3>
+
+<a name="index-pkg_002dconfig"></a>
+<p>On UNIX systems you can use the <i>pkg-config</i> utility (version 0.20
+or later) to automatically select the appropriate compiler and linker
+switches for <i>libconfig</i>. Ensure that the environment variable
+<code>PKG_CONFIG_PATH</code> contains the absolute path to the
+<samp>lib/pkgconfig</samp> subdirectory of the <i>libconfig</i> installation. Then,
+you can compile and link C programs with <i>libconfig</i> as follows:
+</p>
+<div class="smallexample">
+<pre class="smallexample">gcc `pkg-config --cflags libconfig` myprogram.c -o myprogram \
+ `pkg-config --libs libconfig`
+</pre></div>
+<br>
+
+<p>And similarly, for C++ programs:
+</p>
+<div class="smallexample">
+<pre class="smallexample">g++ `pkg-config --cflags libconfig++` myprogram.cpp -o myprogram \
+ `pkg-config --libs libconfig++`
+</pre></div>
+
+<br>
+<p>Note the backticks in the above examples.
+</p>
+<p>When using <b>autoconf</b>, the <code>PKG_CHECK_MODULES</code> m4 macro may be used to check for the presence of a given version of <i>libconfig</i>, and set the appropriate Makefile variables automatically. For example:
+</p>
+<div class="smallexample">
+<pre class="smallexample">PKG_CHECK_MODULES([LIBCONFIGXX], [libconfig++ &gt;= 1.4],,
+ AC_MSG_ERROR([libconfig++ 1.4 or newer not found.])
+)
+</pre></div>
+
+<p>In the above example, if <i>libconfig++</i> version 1.4 or newer is found,
+the Makefile variables <code>LIBCONFIGXX_LIBS</code> and <code>LIBCONFIGXX_CFLAGS</code> will be
+set to the appropriate compiler and linker flags for compiling with
+<i>libconfig</i>, and if it is not found, the configure script will abort
+with an error to that effect.
+</p>
+<hr>
+<a name="Version-Test-Macros"></a>
+<div class="header">
+<p>
+Previous: <a href="#Compiling-Using-pkg_002dconfig" accesskey="p" rel="prev">Compiling Using pkg-config</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Version-Test-Macros-1"></a>
+<h3 class="section">1.7 Version Test Macros</h3>
+
+<p>The <samp>libconfig.h</samp> header declares the following macros:
+</p>
+<dl>
+<dt><a name="index-LIBCONFIG_005fVER_005fMAJOR"></a>Macro: <strong>LIBCONFIG_VER_MAJOR</strong></dt>
+<dt><a name="index-LIBCONFIG_005fVER_005fMINOR"></a>Macro: <strong>LIBCONFIG_VER_MINOR</strong></dt>
+<dt><a name="index-LIBCONFIG_005fVER_005fREVISION"></a>Macro: <strong>LIBCONFIG_VER_REVISION</strong></dt>
+<dd>
+<p>These macros represent the major version, minor version, and revision
+of the <i>libconfig</i> library. For example, in <i>libconfig</i> 1.4 these
+are defined as &lsquo;<samp>1</samp>&rsquo;, &lsquo;<samp>4</samp>&rsquo;, and &lsquo;<samp>0</samp>&rsquo;, respectively. These
+macros can be used in preprocessor directives to determine which
+<i>libconfig</i> features and/or APIs are present. For example:
+</p>
+<div class="smallexample">
+<pre class="smallexample">#if (((LIBCONFIG_VER_MAJOR == 1) &amp;&amp; (LIBCONFIG_VER_MINOR &gt;= 4)) \
+ || (LIBCONFIG_VER_MAJOR &gt; 1))
+ /* use features present in libconfig 1.4 and later */
+#endif
+</pre></div>
+
+<p>These macros were introduced in <i>libconfig</i> 1.4.
+</p>
+</dd></dl>
+
+<p>Similarly, the <samp>libconfig.h++</samp> header declares the following macros:
+</p>
+<dl>
+<dt><a name="index-LIBCONFIGXX_005fVER_005fMAJOR"></a>Macro: <strong>LIBCONFIGXX_VER_MAJOR</strong></dt>
+<dt><a name="index-LIBCONFIGXX_005fVER_005fMINOR"></a>Macro: <strong>LIBCONFIGXX_VER_MINOR</strong></dt>
+<dt><a name="index-LIBCONFIGXX_005fVER_005fREVISION"></a>Macro: <strong>LIBCONFIGXX_VER_REVISION</strong></dt>
+<dd>
+<p>These macros represent the major version, minor version, and revision
+of the <i>libconfig++</i> library.
+</p>
+</dd></dl>
+
+<hr>
+<a name="Configuration-Files"></a>
+<div class="header">
+<p>
+Next: <a href="#The-C-API" accesskey="n" rel="next">The C API</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Settings" accesskey="1">Settings</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Groups" accesskey="2">Groups</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Arrays" accesskey="3">Arrays</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Lists" accesskey="4">Lists</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Integer-Values" accesskey="5">Integer Values</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#g_t64_002dbit-Integer-Values" accesskey="6">64-bit Integer Values</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Floating-Point-Values" accesskey="7">Floating Point Values</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Boolean-Values" accesskey="8">Boolean Values</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#String-Values" accesskey="9">String Values</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Comments">Comments</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Include-Directives">Include Directives</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+<a name="Configuration-Files-1"></a>
+<h2 class="chapter">2 Configuration Files</h2>
+
+<p><i>Libconfig</i> supports structured, hierarchical configurations. These
+configurations can be read from and written to files and manipulated
+in memory.
+</p>
+<a name="index-setting"></a>
+<a name="index-value"></a>
+<a name="index-scalar-value"></a>
+<a name="index-array"></a>
+<a name="index-group"></a>
+<a name="index-list"></a>
+<a name="index-configuration"></a>
+<p>A <em>configuration</em> consists of a group of <em>settings</em>, which
+associate names with values. A <em>value</em> can be one of the
+following:
+</p>
+<ul>
+<li> A <em>scalar value</em>: integer, 64-bit integer, floating-point number, boolean,
+or string
+</li><li> An <em>array</em>, which is a sequence of scalar values, all of which must have the same type
+</li><li> A <em>group</em>, which is a collection of settings
+</li><li> A <em>list</em>, which is a sequence of values of any type, including other lists
+</li></ul>
+
+<p>Consider the following configuration file for a hypothetical GUI
+application, which illustrates all of the elements of the configuration
+file grammar.
+</p>
+<br>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample"># Example application configuration file
+
+version = &quot;1.0&quot;;
+
+application:
+{
+ window:
+ {
+ title = &quot;My Application&quot;;
+ size = { w = 640; h = 480; };
+ pos = { x = 350; y = 250; };
+ };
+
+ list = ( ( &quot;abc&quot;, 123, true ), 1.234, ( /* an empty list */ ) );
+
+ books = ( { title = &quot;Treasure Island&quot;;
+ author = &quot;Robert Louis Stevenson&quot;;
+ price = 29.95;
+ qty = 5; },
+ { title = &quot;Snow Crash&quot;;
+ author = &quot;Neal Stephenson&quot;;
+ price = 9.99;
+ qty = 8; } );
+
+ misc:
+ {
+ pi = 3.141592654;
+ bigint = 9223372036854775807L;
+ columns = [ &quot;Last Name&quot;, &quot;First Name&quot;, &quot;MI&quot; ];
+ bitmask = 0x1FC3; // hex
+ umask = 0027; // octal. Range limited to that of &quot;int&quot;
+ };
+};
+</pre></div>
+</td></tr></table>
+<br>
+
+<a name="index-path"></a>
+<p>Settings can be uniquely identified within the configuration by a
+<em>path</em>. The path is a dot-separated sequence of names, beginning
+at a top-level group and ending at the setting itself. Each name in
+the path is the name of a setting; if the setting has no name because
+it is an element in a list or array, an integer index in square
+brackets can be used as the name.
+</p>
+<p>For example, in our hypothetical configuration file, the path to the
+<code>x</code> setting is <code>application.window.pos.x</code>; the path to the
+<code>version</code> setting is simply <code>version</code>; and the path to the
+<code>title</code> setting of the second book in the <code>books</code> list is
+<code>application.books.[1].title</code>.
+</p>
+<p>The datatype of a value is determined from the format of the value
+itself. If the value is enclosed in double quotes, it is treated as a
+string. If it looks like an integer or floating point number, it is
+treated as such. If it is one of the values <code>TRUE</code>, <code>true</code>,
+<code>FALSE</code>, or <code>false</code> (or any other mixed-case version of
+those tokens, e.g., <code>True</code> or <code>FaLsE</code>), it is treated as a
+boolean. If it consists of a comma-separated list of values enclosed
+in square brackets, it is treated as an array. And if it consists of a
+comma-separated list of values enclosed in parentheses, it is treated
+as a list. Any value which does not meet any of these criteria is
+considered invalid and results in a parse error.
+</p>
+<p>All names are case-sensitive. They may consist only of alphanumeric
+characters, dashes (&lsquo;<samp>-</samp>&rsquo;), underscores (&lsquo;<samp>_</samp>&rsquo;), and asterisks
+(&lsquo;<samp>*</samp>&rsquo;), and must begin with a letter or asterisk. No other
+characters are allowed.
+</p>
+<p>In C and C++, integer, 64-bit integer, floating point, and string
+values are mapped to the native types <code>int</code>, <code>long long</code>,
+<code>double</code>, and <code>const char *</code>, respectively. The boolean type
+is mapped to <code>int</code> in C and <code>bool</code> in C++.
+</p>
+<p>The following sections describe the elements of the configuration file
+grammar in additional detail.
+</p>
+<hr>
+<a name="Settings"></a>
+<div class="header">
+<p>
+Next: <a href="#Groups" accesskey="n" rel="next">Groups</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Settings-1"></a>
+<h3 class="section">2.1 Settings</h3>
+
+<p>A setting has the form:
+</p>
+<p><i>name</i> <b>=</b> <i>value</i> <b>;</b>
+</p>
+<p>or:
+</p>
+<p><i>name</i> <b>:</b> <i>value</i> <b>;</b>
+</p>
+<p>The trailing semicolon is optional. Whitespace is not significant.
+</p>
+<p>The value may be a scalar value, an array, a group, or a list.
+</p>
+<hr>
+<a name="Groups"></a>
+<div class="header">
+<p>
+Next: <a href="#Arrays" accesskey="n" rel="next">Arrays</a>, Previous: <a href="#Settings" accesskey="p" rel="prev">Settings</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Groups-1"></a>
+<h3 class="section">2.2 Groups</h3>
+
+<p>A group has the form:
+</p>
+<p><b>{</b>
+ <i>settings ...</i>
+<b>}</b>
+</p>
+<p>Groups can contain any number of settings, but each setting must have
+a unique name within the group.
+</p>
+<hr>
+<a name="Arrays"></a>
+<div class="header">
+<p>
+Next: <a href="#Lists" accesskey="n" rel="next">Lists</a>, Previous: <a href="#Groups" accesskey="p" rel="prev">Groups</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Arrays-1"></a>
+<h3 class="section">2.3 Arrays</h3>
+
+<p>An array has the form:
+</p>
+<p><b>[</b> <i>value</i><b>,</b> <i>value ...</i> <b>]</b>
+</p>
+<p>An array may have zero or more elements, but the elements must all be
+scalar values of the same type.
+</p>
+<p>The last element in an array may be followed by a comma, which will be ignored.
+</p>
+<hr>
+<a name="Lists"></a>
+<div class="header">
+<p>
+Next: <a href="#Integer-Values" accesskey="n" rel="next">Integer Values</a>, Previous: <a href="#Arrays" accesskey="p" rel="prev">Arrays</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Lists-1"></a>
+<h3 class="section">2.4 Lists</h3>
+
+<p>A list has the form:
+</p>
+<p><b>(</b> <i>value</i><b>,</b> <i>value ...</i> <b>)</b>
+</p>
+<p>A list may have zero or more elements, each of which can be a scalar
+value, an array, a group, or another list.
+</p>
+<p>The last element in a list may be followed by a comma, which will be ignored.
+</p>
+<hr>
+<a name="Integer-Values"></a>
+<div class="header">
+<p>
+Next: <a href="#g_t64_002dbit-Integer-Values" accesskey="n" rel="next">64-bit Integer Values</a>, Previous: <a href="#Lists" accesskey="p" rel="prev">Lists</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Integer-Values-1"></a>
+<h3 class="section">2.5 Integer Values</h3>
+
+<p>Integers can be represented in one of two ways: as a series of one or
+more decimal digits (&lsquo;<samp>0</samp>&rsquo; - &lsquo;<samp>9</samp>&rsquo;), with an optional leading
+sign character (&lsquo;<samp>+</samp>&rsquo; or &lsquo;<samp>-</samp>&rsquo;); or as a hexadecimal value
+consisting of the characters &lsquo;<samp>0x</samp>&rsquo; followed by a series of one or
+more hexadecimal digits (&lsquo;<samp>0</samp>&rsquo; - &lsquo;<samp>9</samp>&rsquo;, &lsquo;<samp>A</samp>&rsquo; - &lsquo;<samp>F</samp>&rsquo;,
+&lsquo;<samp>a</samp>&rsquo; - &lsquo;<samp>f</samp>&rsquo;). Additionally, octal notation integers (that is,
+those having a leading zero with non-zero value) are also allowed.
+</p>
+<hr>
+<a name="g_t64_002dbit-Integer-Values"></a>
+<div class="header">
+<p>
+Next: <a href="#Floating-Point-Values" accesskey="n" rel="next">Floating Point Values</a>, Previous: <a href="#Integer-Values" accesskey="p" rel="prev">Integer Values</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="g_t64_002dbit-Integer-Values-1"></a>
+<h3 class="section">2.6 64-bit Integer Values</h3>
+
+<p>Long long (64-bit) integers are represented identically to integers,
+except that an &lsquo;L&rsquo; character is appended to indicate a 64-bit
+value. For example, &lsquo;<samp>0L</samp>&rsquo; indicates a 64-bit integer value 0. As
+of version 1.5 of the library, the trailing &lsquo;L&rsquo; is optional; if the
+integer value exceeds the range of a 32-bit integer, it will
+automatically be interpreted as a 64-bit integer.
+</p>
+<p>The <i>integer</i> and <i>64-bit integer</i> setting types are interchangeable to the
+extent that a conversion between the corresponding native types would not
+result in an overflow or underflow. For example, a <i>long long</i> value can be
+written to a setting that has an <i>integer</i> type, if that value is within the
+range of an <i>int</i>. This rule applies to every API function or method that
+reads a value from or writes a value to a setting: if the type conversion would
+not result in an overflow or underflow, then the call will succeed, and
+otherwise it will fail. This behavior was not well-defined prior to version 1.7
+of the library.
+</p>
+<hr>
+<a name="Floating-Point-Values"></a>
+<div class="header">
+<p>
+Next: <a href="#Boolean-Values" accesskey="n" rel="next">Boolean Values</a>, Previous: <a href="#g_t64_002dbit-Integer-Values" accesskey="p" rel="prev">64-bit Integer Values</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Floating-Point-Values-1"></a>
+<h3 class="section">2.7 Floating Point Values</h3>
+
+<p>Floating point values consist of a series of one or more digits, one
+decimal point, an optional leading sign character (&lsquo;<samp>+</samp>&rsquo; or
+&lsquo;<samp>-</samp>&rsquo;), and an optional exponent. An exponent consists of the
+letter &lsquo;<samp>E</samp>&rsquo; or &lsquo;<samp>e</samp>&rsquo;, an optional sign character, and a series
+of one or more digits.
+</p>
+<hr>
+<a name="Boolean-Values"></a>
+<div class="header">
+<p>
+Next: <a href="#String-Values" accesskey="n" rel="next">String Values</a>, Previous: <a href="#Floating-Point-Values" accesskey="p" rel="prev">Floating Point Values</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Boolean-Values-1"></a>
+<h3 class="section">2.8 Boolean Values</h3>
+
+<p>Boolean values may have one of the following values: &lsquo;<samp>true</samp>&rsquo;,
+&lsquo;<samp>false</samp>&rsquo;, or any mixed-case variation thereof.
+</p>
+<hr>
+<a name="String-Values"></a>
+<div class="header">
+<p>
+Next: <a href="#Comments" accesskey="n" rel="next">Comments</a>, Previous: <a href="#Boolean-Values" accesskey="p" rel="prev">Boolean Values</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="String-Values-1"></a>
+<h3 class="section">2.9 String Values</h3>
+
+<a name="index-escape-sequence"></a>
+<p>String values consist of arbitrary text delimited by double
+quotes. Literal double quotes can be escaped by preceding them with a
+backslash: &lsquo;<samp>\&quot;</samp>&rsquo;. The escape sequences &lsquo;<samp>\\</samp>&rsquo;, &lsquo;<samp>\f</samp>&rsquo;,
+&lsquo;<samp>\n</samp>&rsquo;, &lsquo;<samp>\r</samp>&rsquo;, and &lsquo;<samp>\t</samp>&rsquo; are also recognized, and have the
+usual meaning.
+</p>
+<p>In addition, the &lsquo;<samp>\x</samp>&rsquo; escape sequence is supported; this sequence
+must be followed by <i>exactly two</i> hexadecimal digits, which represent an
+8-bit ASCII value. For example, &lsquo;<samp>\xFF</samp>&rsquo; represents the character
+with ASCII code 0xFF.
+</p>
+<p>No other escape sequences are currently supported.
+</p>
+<p>Adjacent strings are automatically concatenated, as in C/C++ source
+code. This is useful for formatting very long strings as sequences of
+shorter strings. For example, the following constructs are equivalent:
+</p>
+<ul>
+<li> <code>&quot;The quick brown fox jumped over the lazy dog.&quot;</code>
+
+</li><li> <code>&quot;The quick brown fox&quot;</code> <br>
+<code>&quot; jumped over the lazy dog.&quot;</code>
+
+</li><li> <code>&quot;The quick&quot; /* comment */ &quot; brown fox &quot; // another comment</code> <br>
+<code>&quot;jumped over the lazy dog.&quot;</code>
+
+</li></ul>
+<hr>
+<a name="Comments"></a>
+<div class="header">
+<p>
+Next: <a href="#Include-Directives" accesskey="n" rel="next">Include Directives</a>, Previous: <a href="#String-Values" accesskey="p" rel="prev">String Values</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Comments-1"></a>
+<h3 class="section">2.10 Comments</h3>
+
+<a name="index-comment"></a>
+<p>Three types of comments are allowed within a configuration:
+</p>
+<ul>
+<li> Script-style comments. All text beginning with a &lsquo;<samp>#</samp>&rsquo; character
+to the end of the line is ignored.
+
+</li><li> C-style comments. All text, including line breaks, between a starting
+&lsquo;<samp>/*</samp>&rsquo; sequence and an ending &lsquo;<samp>*/</samp>&rsquo; sequence is ignored.
+
+</li><li> C++-style comments. All text beginning with a &lsquo;<samp>//</samp>&rsquo; sequence to the
+end of the line is ignored.
+
+</li></ul>
+
+<p>As expected, comment delimiters appearing within quoted strings are
+treated as literal text.
+</p>
+<p>Comments are ignored when the configuration is read in, so they are
+not treated as part of the configuration. Therefore if the
+configuration is written back out to a stream, any comments that were
+present in the original configuration will be lost.
+</p>
+
+<hr>
+<a name="Include-Directives"></a>
+<div class="header">
+<p>
+Previous: <a href="#Comments" accesskey="p" rel="prev">Comments</a>, Up: <a href="#Configuration-Files" accesskey="u" rel="up">Configuration Files</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Include-Directives-1"></a>
+<h3 class="section">2.11 Include Directives</h3>
+
+<a name="index-include-directive"></a>
+<p>A configuration file may &ldquo;include&rdquo; the contents of other files
+using an <i>include directive</i>. This directive has the effect of
+inlining the contents of the named file(s) at the point of inclusion.
+</p>
+<p>An include directive must appear on its own line in the input. It has
+the form:
+</p>
+<p><b>@include &quot;</b><i>path</i><b>&quot;</b>
+</p>
+<a name="index-include-function"></a>
+<p>The interpretation of <i>path</i> depends on the currently registered
+<i>include function</i>. The default include function prepends the include
+directory, if any, to <i>path</i>, and then interprets the result as a single,
+literal file path. The application may supply its own include function which
+does variable substitution, wildcard expansion, or other transformations,
+returning a list of zero or more paths to files whose contents should be inlined
+at the point of inclusion.
+</p>
+<p>Any backslashes or double quotes in the path must be escaped as
+&lsquo;<samp>\\</samp>&rsquo; and &lsquo;<samp>\&quot;</samp>&rsquo;, respectively.
+</p>
+<p>For example, consider the following two configuration files:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample"># file: quote.cfg
+quote = &quot;Criticism may not be agreeable, but it is necessary.&quot;
+ &quot; It fulfils the same function as pain in the human&quot;
+ &quot; body. It calls attention to an unhealthy state of&quot;
+ &quot; things.\n&quot;
+ &quot;\t--Winston Churchill&quot;;
+</pre></div>
+</td></tr></table>
+
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample"># file: test.cfg
+info: {
+ name = &quot;Winston Churchill&quot;;
+ @include &quot;quote.cfg&quot;
+ country = &quot;UK&quot;;
+};
+</pre></div>
+</td></tr></table>
+
+<p>The resulting configuration will be equivalent to one in which the
+contents of the file &lsquo;<samp>quote.cfg</samp>&rsquo; appeared at the point where the
+include directive is placed.
+</p>
+<p>Include files may be nested to a maximum of 10 levels; exceeding this
+limit results in a parse error.
+</p>
+<p>When the path argument to an <b>@include</b> directive is a relative
+path, then it will be interpreted as being relative to the include
+directory that has been been set by means of
+<code>config_set_include_dir()</code>. If no include directory has been set,
+then it will be taken as being relative to the program&rsquo;s current
+working directory.
+</p>
+<p>Like comments, include directives are not part of the configuration
+file syntax. They are processed before the configuration itself is
+parsed. Therefore, they are not preserved when the configuration is
+written back out to a stream. There is presently no support for
+programmatically inserting include directives into a configuration.
+</p>
+<hr>
+<a name="The-C-API"></a>
+<div class="header">
+<p>
+Next: <a href="#The-C_002b_002b-API" accesskey="n" rel="next">The C++ API</a>, Previous: <a href="#Configuration-Files" accesskey="p" rel="prev">Configuration Files</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="The-C-API-1"></a>
+<h2 class="chapter">3 The C API</h2>
+
+<a name="index-config_005ft"></a>
+<a name="index-config_005fsetting_005ft"></a>
+<p>This chapter describes the C library API. The type <i>config_t</i>
+represents a configuration, and the type <i>config_setting_t</i> represents
+a configuration setting.
+</p>
+<p>The boolean values <code>CONFIG_TRUE</code> and <code>CONFIG_FALSE</code> are
+macros defined as <code>(1)</code> and <code>(0)</code>, respectively.
+</p>
+<dl>
+<dt><a name="index-config_005finit"></a>Function: <em>void</em> <strong>config_init</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fdestroy"></a>Function: <em>void</em> <strong>config_destroy</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions initialize and destroy the configuration object <var>config</var>.
+</p>
+<p><code>config_init()</code> initializes the <i>config_t</i> structure pointed to by
+<var>config</var> as a new, empty configuration.
+</p>
+<p><code>config_destroy()</code> destroys the configuration <var>config</var>,
+deallocating all memory associated with the configuration, but does not
+attempt to deallocate the <i>config_t</i> structure itself.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fclear"></a>Function: <em>void</em> <strong>config_clear</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<p>This function clears the configuration <var>config</var>. All child settings of the
+root setting are recursively destroyed. All other attributes of the configuration
+are left unchanged.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fread"></a>Function: <em>int</em> <strong>config_read</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, FILE&nbsp;*&nbsp;<var>stream</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function reads and parses a configuration from the given
+<var>stream</var> into the configuration object <var>config</var>. It returns
+<code>CONFIG_TRUE</code> on success, or <code>CONFIG_FALSE</code> on failure; the
+<code>config_error_text()</code>, <code>config_error_file()</code>,
+<code>config_error_line()</code>, and <code>config_error_type()</code> functions,
+described below, can be used to obtain information about the error.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fread_005ffile"></a>Function: <em>int</em> <strong>config_read_file</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>filename</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function reads and parses a configuration from the file named
+<var>filename</var> into the configuration object <var>config</var>. It returns
+<code>CONFIG_TRUE</code> on success, or <code>CONFIG_FALSE</code> on failure; the
+<code>config_error_text()</code> and <code>config_error_line()</code> functions,
+described below, can be used to obtain information about the error.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fread_005fstring"></a>Function: <em>int</em> <strong>config_read_string</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>str</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function reads and parses a configuration from the string
+<var>str</var> into the configuration object <var>config</var>. It returns
+<code>CONFIG_TRUE</code> on success, or <code>CONFIG_FALSE</code> on failure; the
+<code>config_error_text()</code> and <code>config_error_line()</code> functions,
+described below, can be used to obtain information about the error.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fwrite"></a>Function: <em>void</em> <strong>config_write</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, FILE&nbsp;*&nbsp;<var>stream</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function writes the configuration <var>config</var> to the given
+<var>stream</var>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fwrite_005ffile"></a>Function: <em>int</em> <strong>config_write_file</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>filename</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function writes the configuration <var>config</var> to the file named
+<var>filename</var>. It returns <code>CONFIG_TRUE</code> on success, or
+<code>CONFIG_FALSE</code> on failure.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005ferror_005ftext"></a>Function: <em>const char *</em> <strong>config_error_text</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005ferror_005ffile"></a>Function: <em>const char *</em> <strong>config_error_file</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005ferror_005fline"></a>Function: <em>int</em> <strong>config_error_line</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions, which are implemented as macros, return the text,
+filename, and line number of the parse error, if one occurred during a
+call to <code>config_read()</code>, <code>config_read_string()</code>, or
+<code>config_read_file()</code>. Storage for the strings returned by
+<code>config_error_text()</code> and <code>config_error_file()</code> are managed
+by the library and released automatically when the configuration is
+destroyed; these strings must not be freed by the caller. If the error
+occurred in text that was read from a string or stream,
+<code>config_error_file()</code> will return NULL.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005ferror_005ftype"></a>Function: <em>config_error_t</em> <strong>config_error_type</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dd><a name="index-config_005ferror_005ft"></a>
+<p>This function, which is implemented as a macro, returns the type of
+error that occurred during the last call to one of the read or write
+functions. The <var>config_error_t</var> type is an enumeration with the
+following values: <code>CONFIG_ERR_NONE</code>, <code>CONFIG_ERR_FILE_IO</code>,
+<code>CONFIG_ERR_PARSE</code>. These represent success, a file I/O error,
+and a parsing error, respectively.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fset_005finclude_005fdir"></a>Function: <em>void</em> <strong>config_set_include_dir</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*<var><span class="nolinebreak">include_dir</span></var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fget_005finclude_005fdir"></a>Function: <em>const char *</em> <strong>config_get_include_dir</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->)</em></dt>
+<dd>
+<p><code>config_set_include_dir()</code> specifies the include directory,
+<var>include_dir</var>, relative to which the files specified in
+&lsquo;<samp>@include</samp>&rsquo; directives will be located for the configuration
+<var>config</var>. By default, there is no include directory, and all
+include files are expected to be relative to the current working
+directory. If <var>include_dir</var> is <code>NULL</code>, the default behavior
+is reinstated.
+</p>
+<p>For example, if the include directory is set to <samp>/usr/local/etc</samp>,
+the include directive &lsquo;<samp>@include &quot;configs/extra.cfg&quot;</samp>&rsquo; would include the
+file <samp>/usr/local/etc/configs/extra.cfg</samp>.
+</p>
+<p><code>config_get_include_dir()</code> returns the current include directory for the
+configuration <var>config</var>, or <code>NULL</code> if none is set.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fset_005finclude_005ffunc"></a>Function: <em>void</em> <strong>config_set_include_func</strong> <em>(<span class="nolinebreak">config_include_fn_t</span>&nbsp;<var>func</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<p>Specifies the include function <var>func</var> to use when processing
+include directives. If <var>func</var> is <code>NULL</code>, the default include function,
+<code>config_default_include_func()</code>, will be reinstated.
+</p>
+<a name="index-config_005finclude_005ffn_005ft"></a>
+<p>The type <i>config_include_fn_t</i> is a type alias
+for a function whose signature is:
+</p>
+<dl>
+<dt><a name="index-func"></a>Function: <em>const&nbsp;char&nbsp;**<!-- /@w --></em> <strong>func</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*<var><span class="nolinebreak">include_dir</span></var><!-- /@w -->, const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, const&nbsp;char&nbsp;**<var>error</var><!-- /@w -->)</em></dt>
+<dd>
+<p>The function receives the configuration <var>config</var>, the
+configuration&rsquo;s current include directory <var>include_dir</var>, the
+argument to the include directive <var>path</var>; and a pointer at which
+to return an error message <var>error</var>.
+</p>
+<p>On success, the function should return a <code>NULL</code>-terminated array
+of paths. Any relative paths must be relative to the program&rsquo;s current
+working directory. The contents of these files will be inlined at the point
+of inclusion, in the order that the paths appear in the
+array. Both the array and its elements should be heap allocated; the
+library will take ownership of and eventually free the strings in the
+array and the array itself.
+</p>
+<p>On failure, the function should return <code>NULL</code> and set <var>*error</var> to a
+static error string which should be used as the parse error for the
+configuration; the library does not take ownership of or free this string.
+</p>
+<p>The default include function, <code>config_default_include_func()</code>,
+simply returns a <code>NULL</code>-terminated array containing either a copy
+of <var>path</var> if it&rsquo;s an absolute path, or a concatenation of
+<var>include_dir</var> and <var>path</var> if it&rsquo;s a relative path.
+</p>
+</dd></dl>
+
+<p>Application-supplied include functions can perform custom tasks like wildcard
+expansion or variable substitution. For example, consider the include directive:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">@include &quot;configs/*.cfg&quot;
+</pre></div>
+</td></tr></table>
+
+<p>The include function would be invoked with the path &lsquo;<samp>configs/*.cfg</samp>&rsquo; and
+could do wildcard expansion on that path, returning a list of paths to files
+with the file extension &lsquo;<samp>.cfg</samp>&rsquo; in the subdirectory &lsquo;<samp>configs</samp>&rsquo;. Each of
+these files would then be inlined at the location of the include directive.
+</p>
+<p>Tasks like wildcard expansion and variable substitution are non-trivial to
+implement and typically require platform-specific code. In the interests of
+keeping the library as compact and platform-independent as possible,
+implementations of such include functions are not included.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fget_005ffloat_005fprecision_0028config_005ft-_002aconfig_0029"></a>Function: <em>unsigned short</em> <strong>config_get_float_precision(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->)</strong></dt>
+<dt><a name="index-config_005fset_005ffloat_005fprecision_0028config_005ft-_002aconfig_002c"></a>Function: <em>void</em> <strong>config_set_float_precision(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->,</strong> <em>unsigned&nbsp;short&nbsp;<var>digits</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.6</i></b>
+</p>
+<p>These functions get and set the number of decimal digits to output after the
+radix character when writing the configuration to a file or stream.
+</p>
+<p>Valid values for <var>digits</var> range from 0 (no decimals) to about 15
+(implementation defined). This parameter has no effect on parsing.
+</p>
+<p>The default float precision is 6.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fget_005foptions"></a>Function: <em>int</em> <strong>config_get_options</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fset_005foptions"></a>Function: <em>void</em> <strong>config_set_options</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->, int&nbsp;<var>options</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions get and set the options for the configuration
+<var>config</var>. The options affect how configurations are read and
+written. The following options are defined:
+</p>
+<dl compact="compact">
+<dt><code>CONFIG_OPTION_AUTOCONVERT</code></dt>
+<dd><p>Turning this option on enables number auto-conversion for
+the configuration. When this feature is enabled, an attempt to retrieve a
+floating point setting&rsquo;s value into an integer (or vice versa), or
+store an integer to a floating point setting&rsquo;s value (or vice versa)
+will cause the library to silently perform the necessary conversion
+(possibly leading to loss of data), rather than reporting failure. By
+default this option is turned off.
+</p>
+</dd>
+<dt><code>CONFIG_OPTION_SEMICOLON_SEPARATORS</code></dt>
+<dd><p>This option controls whether a semicolon (&lsquo;;&rsquo;) is output after each setting
+when the configuration is written to a file or stream. (The semicolon
+separators are optional in the configuration syntax.) By default this
+option is turned on.
+</p>
+</dd>
+<dt><code>CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS</code></dt>
+<dd><p>This option controls whether a colon (&lsquo;:&rsquo;) is output between each
+group setting&rsquo;s name and its value when the configuration is written to
+a file or stream. If the option is turned off, an equals sign (&lsquo;=&rsquo;) is
+output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned on.
+</p>
+</dd>
+<dt><code>CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS</code></dt>
+<dd><p>This option controls whether a colon (&lsquo;:&rsquo;) is output between each
+non-group setting&rsquo;s name and its value when the configuration is written
+to a file or stream. If the option is turned off, an equals sign (&lsquo;=&rsquo;)
+is output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned off.
+</p>
+</dd>
+<dt><code>CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE</code></dt>
+<dd><p>This option controls whether an open brace (&lsquo;{&rsquo;) will be written on its own
+line when the configuration is written to a file or stream. If the option is
+turned off, the brace will be written at the end of the previous line.
+By default this option is turned on.
+</p>
+</dd>
+<dt><code>CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION</code></dt>
+<dd><p>(<b>Since <i>v1.7</i></b>)
+This option controls whether scientific notation may be used as appropriate
+when writing floating point values (corresponding to <code>printf()</code>
+&lsquo;<samp>%g</samp>&rsquo; format) or should never be used (corresponding to <code>printf()</code>
+&lsquo;<samp>%f</samp>&rsquo; format). By default this option is turned off.
+</p>
+</dd>
+<dt><code>CONFIG_OPTION_FSYNC</code></dt>
+<dd><p>(<b>Since <i>v1.7.1</i></b>)
+This option controls whether the <code>config_write_file()</code> function performs
+an <i>fsync</i> operation after writing the configuration and before closing the
+file. By default this option is turned off.
+</p></dd>
+</dl>
+
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fget_005foption"></a>Function: <em>int</em> <strong>config_get_option</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->, int&nbsp;<var>option</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fset_005foption"></a>Function: <em>void</em> <strong>config_set_option</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->, int&nbsp;<var>option</var><!-- /@w -->, int&nbsp;<var>flag</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<p>These functions get and set the given <var>option</var> of the configuration
+<var>config</var>. The option is enabled if <var>flag</var> is <code>CONFIG_TRUE</code> and
+disabled if it is <code>CONFIG_FALSE</code>.
+</p>
+<p>See <code>config_set_options()</code> above for the list of available options.
+</p>
+</dd></dl>
+
+
+<dl>
+<dt><a name="index-config_005fget_005fauto_005fconvert"></a>Function: <em>int</em> <strong>config_get_auto_convert</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fset_005fauto_005fconvert"></a>Function: <em>void</em> <strong>config_set_auto_convert</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->, int&nbsp;<var>flag</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions get and set the <code>CONFIG_OPTION_AUTO_CONVERT</code>
+option. They are obsoleted by the <code>config_set_option()</code> and
+<code>config_get_option()</code> functions described above.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fget_005fdefault_005fformat"></a>Function: <em>short</em> <strong>config_get_default_format</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fset_005fdefault_005fformat"></a>Function: <em>void</em> <strong>config_set_default_format</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, short&nbsp;<var>format</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions, which are implemented as macros, get and set the
+default external format for settings in the configuration
+<var>config</var>. If a non-default format has not been set for a setting
+with <code>config_setting_set_format()</code>, this configuration-wide
+default format will be used instead when that setting is written to a
+file or stream.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fget_005ftab_005fwidth"></a>Function: <em>unsigned short</em> <strong>config_get_tab_width</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fset_005ftab_005fwidth"></a>Function: <em>void</em> <strong>config_set_tab_width</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, unsigned&nbsp;short&nbsp;<var>width</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions, which are implemented as macros, get and set the tab
+width for the configuration <var>config</var>. The tab width affects the
+formatting of the configuration when it is written to a file or
+stream: each level of nesting is indented by <var>width</var> spaces, or
+by a single tab character if <var>width</var> is 0. The tab width has no
+effect on parsing.
+</p>
+<p>Valid tab widths range from 0 to 15. The default tab width is 2.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005flookup_005fint"></a>Function: <em>int</em> <strong>config_lookup_int</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->, int&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005flookup_005fint64"></a>Function: <em>int</em> <strong>config_lookup_int64</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->, long&nbsp;long&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005flookup_005ffloat"></a>Function: <em>int</em> <strong>config_lookup_float</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->, double&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005flookup_005fbool"></a>Function: <em>int</em> <strong>config_lookup_bool</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->, int&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005flookup_005fstring"></a>Function: <em>int</em> <strong>config_lookup_string</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->, const&nbsp;char&nbsp;**&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions look up the value of the setting in the configuration
+<var>config</var> specified by the path <var>path</var>. They store the value of
+the setting at <var>value</var> and return <code>CONFIG_TRUE</code> on
+success. If the setting was not found or if the type of the value did
+not match the type requested, they leave the data pointed to by
+<var>value</var> unmodified and return <code>CONFIG_FALSE</code>.
+</p>
+<p>Storage for the string returned by <code>config_lookup_string()</code> is
+managed by the library and released automatically when the setting is
+destroyed or when the setting&rsquo;s value is changed; the string must not
+be freed by the caller.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005flookup"></a>Function: <em>config_setting_t *</em> <strong>config_lookup</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function locates the setting in the configuration <var>config</var>
+specified by the path <var>path</var>. It returns a pointer to the
+<code>config_setting_t</code> structure on success, or <code>NULL</code> if the
+setting was not found.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005flookup"></a>Function: <em>config_setting_t *</em> <strong>config_setting_lookup</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function locates a setting by a path <var>path</var> relative to
+the setting <var>setting</var>. It returns a pointer to the
+<code>config_setting_t</code> structure on success, or <code>NULL</code> if the
+setting was not found.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fget_005fint"></a>Function: <em>int</em> <strong>config_setting_get_int</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fint64"></a>Function: <em>long long</em> <strong>config_setting_get_int64</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005ffloat"></a>Function: <em>double</em> <strong>config_setting_get_float</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fbool"></a>Function: <em>int</em> <strong>config_setting_get_bool</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fstring"></a>Function: <em>const char *</em> <strong>config_setting_get_string</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions return the value of the given <var>setting</var>. If the
+type of the setting does not match the type requested, a 0 or
+<code>NULL</code> value is returned. Storage for the string returned by
+<code>config_setting_get_string()</code> is managed by the library and
+released automatically when the setting is destroyed or when the
+setting&rsquo;s value is changed; the string must not be freed by the
+caller.
+</p>
+</dd></dl>
+<dl>
+<dt><a name="index-config_005fsetting_005fset_005fint"></a>Function: <em>int</em> <strong>config_setting_set_int</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fint64"></a>Function: <em>int</em> <strong>config_setting_set_int64</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, long&nbsp;long&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005ffloat"></a>Function: <em>int</em> <strong>config_setting_set_float</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, double&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fbool"></a>Function: <em>int</em> <strong>config_setting_set_bool</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fstring"></a>Function: <em>int</em> <strong>config_setting_set_string</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions set the value of the given <var>setting</var> to
+<var>value</var>. On success, they return <code>CONFIG_TRUE</code>. If
+the setting does not match the type of the value, they return
+<code>CONFIG_FALSE</code>. <code>config_setting_set_string()</code> makes a copy
+of the passed string <var>value</var>, so it may be subsequently freed or
+modified by the caller without affecting the value of the setting.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005flookup_005fint"></a>Function: <em>int</em> <strong>config_setting_lookup_int</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->, int&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005flookup_005fint64"></a>Function: <em>int</em> <strong>config_setting_lookup_int64</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->, long&nbsp;long&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005flookup_005ffloat"></a>Function: <em>int</em> <strong>config_setting_lookup_float</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->, double&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005flookup_005fbool"></a>Function: <em>int</em> <strong>config_setting_lookup_bool</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->, int&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005flookup_005fstring"></a>Function: <em>int</em> <strong>config_setting_lookup_string</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->, const&nbsp;char&nbsp;**&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions look up the value of the child setting named
+<var>name</var> of the setting <var>setting</var>. They store the value at
+<var>value</var> and return <code>CONFIG_TRUE</code> on success. If the setting
+was not found or if the type of the value did not match the type
+requested, they leave the data pointed to by <var>value</var> unmodified
+and return <code>CONFIG_FALSE</code>.
+</p>
+<p>Storage for the string returned by <code>config_setting_lookup_string()</code> is
+managed by the library and released automatically when the setting is
+destroyed or when the setting&rsquo;s value is changed; the string must not
+be freed by the caller.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fget_005fformat"></a>Function: <em>short</em> <strong>config_setting_get_format</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fformat"></a>Function: <em>int</em> <strong>config_setting_set_format</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, short&nbsp;<var>format</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions get and set the external format for the setting <var>setting</var>.
+</p>
+<a name="index-SettingFormat"></a>
+<a name="index-format"></a>
+
+<p>The <var>format</var> must be one of the constants
+<code>CONFIG_FORMAT_DEFAULT</code> or <code>CONFIG_FORMAT_HEX</code>. All settings
+support the <code>CONFIG_FORMAT_DEFAULT</code> format. The
+<code>CONFIG_FORMAT_HEX</code> format specifies hexadecimal formatting for
+integer values, and hence only applies to settings of type
+<code>CONFIG_TYPE_INT</code> and <code>CONFIG_TYPE_INT64</code>. If <var>format</var>
+is invalid for the given setting, it is ignored.
+</p>
+<p>If a non-default format has not been set for the setting, <code>config_setting_get_format()</code> returns the default format for the configuration, as set by <code>config_set_default_format()</code>.
+</p>
+<p><code>config_setting_set_format()</code> returns <code>CONFIG_TRUE</code> on
+success and <code>CONFIG_FALSE</code> on failure.
+</p>
+</dd></dl>
+
+
+<dl>
+<dt><a name="index-config_005fsetting_005fget_005fmember"></a>Function: <em>config_setting_t *</em> <strong>config_setting_get_member</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function fetches the child setting named <var>name</var> from the group
+<var>setting</var>. It returns the requested setting on success, or
+<code>NULL</code> if the setting was not found or if <var>setting</var> is not a
+group.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fget_005felem"></a>Function: <em>config_setting_t *</em> <strong>config_setting_get_elem</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, unsigned&nbsp;int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function fetches the element at the given index <var>index</var> in the
+setting <var>setting</var>, which must be an array, list, or group. It returns the
+requested setting on success, or <code>NULL</code> if <var>index</var> is out of
+range or if <var>setting</var> is not an array, list, or group.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fget_005fint_005felem"></a>Function: <em>int</em> <strong>config_setting_get_int_elem</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fint64_005felem"></a>Function: <em>long long</em> <strong>config_setting_get_int64_elem</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005ffloat_005felem"></a>Function: <em>double</em> <strong>config_setting_get_float_elem</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fbool_005felem"></a>Function: <em>int</em> <strong>config_setting_get_bool_elem</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fstring_005felem"></a>Function: <em>const char *</em> <strong>config_setting_get_string_elem</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions return the value at the specified index <var>index</var> in the
+setting <var>setting</var>. If the setting is not an array or list, or if
+the type of the element does not match the type requested, or if
+<var>index</var> is out of range, they return 0 or <code>NULL</code>. Storage for
+the string returned by <code>config_setting_get_string_elem()</code> is
+managed by the library and released automatically when the setting is
+destroyed or when its value is changed; the string must not be freed
+by the caller.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fset_005fint_005felem"></a>Function: <em>config_setting_t *</em> <strong>config_setting_set_int_elem</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->, int&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fint64_005felem"></a>Function: <em>config_setting_t *</em> <strong>config_setting_set_int64_elem</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->, long&nbsp;long&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005ffloat_005felem"></a>Function: <em>config_setting_t *</em> <strong>config_setting_set_float_elem</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->, double&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fbool_005felem"></a>Function: <em>config_setting_t *</em> <strong>config_setting_set_bool_elem</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->, int&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fset_005fstring_005felem"></a>Function: <em>config_setting_t *</em> <strong>config_setting_set_string_elem</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These functions set the value at the specified index <var>index</var> in the
+setting <var>setting</var> to <var>value</var>. If <var>index</var> is negative, a
+new element is added to the end of the array or list. On success,
+these functions return a pointer to the setting representing the
+element. If the setting is not an array or list, or if the setting is
+an array and the type of the array does not match the type of the
+value, or if <var>index</var> is out of range, they return
+<code>NULL</code>. <code>config_setting_set_string_elem()</code> makes a copy of
+the passed string <var>value</var>, so it may be subsequently freed or
+modified by the caller without affecting the value of the setting.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fadd"></a>Function: <em>config_setting_t *</em> <strong>config_setting_add</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>parent</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->, int&nbsp;<var>type</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function adds a new child setting or element to the setting
+<var>parent</var>, which must be a group, array, or list. If <var>parent</var>
+is an array or list, the <var>name</var> parameter is ignored and may be
+<code>NULL</code>.
+</p>
+<p>The function returns the new setting on success, or <code>NULL</code> if
+<var>parent</var> is not a group, array, or list; or if there is already a
+child setting of <var>parent</var> named <var>name</var>; or if <var>type</var> is
+invalid. If <var>type</var> is a scalar type, the new setting will have a
+default value of 0, 0.0, <code>false</code>, or <code>NULL</code>, as appropriate.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fremove"></a>Function: <em>int</em> <strong>config_setting_remove</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>parent</var><!-- /@w -->, const&nbsp;char&nbsp;*&nbsp;<var>name</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function removes and destroys the setting named <var>name</var> from
+the parent setting <var>parent</var>, which must be a group. Any child
+settings of the setting are recursively destroyed as well.
+</p>
+<p>The <var>name</var> parameter can also specify a setting <i>path</i> relative to
+the provided <var>parent</var>.
+(In that case, the setting will be looked up and removed.)
+</p>
+<p>The function returns <code>CONFIG_TRUE</code> on success. If <var>parent</var> is
+not a group, or if it has no setting with the given name, it returns
+<code>CONFIG_FALSE</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fremove_005felem"></a>Function: <em>int</em> <strong>config_setting_remove_elem</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>parent</var><!-- /@w -->, unsigned&nbsp;int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function removes the child setting at the given index <var>index</var> from
+the setting <var>parent</var>, which must be a group, list, or array. Any
+child settings of the removed setting are recursively destroyed as
+well.
+</p>
+<p>The function returns <code>CONFIG_TRUE</code> on success. If <var>parent</var> is
+not a group, list, or array, or if <var>index</var> is out of range, it returns
+<code>CONFIG_FALSE</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005froot_005fsetting"></a>Function: <em>config_setting_t *</em> <strong>config_root_setting</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function, which is implemented as a macro, returns the root setting for the configuration <var>config</var>. The root setting is a group.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fname"></a>Function: <em>const char *</em> <strong>config_setting_name</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the name of the given <var>setting</var>, or
+<code>NULL</code> if the setting has no name. Storage for the returned
+string is managed by the library and released automatically when the
+setting is destroyed; the string must not be freed by the caller.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fparent"></a>Function: <em>config_setting_t *</em> <strong>config_setting_parent</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the parent setting of the given <var>setting</var>,
+or <code>NULL</code> if <var>setting</var> is the root setting.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fis_005froot"></a>Function: <em>int</em> <strong>config_setting_is_root</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns <code>CONFIG_TRUE</code> if the given <var>setting</var> is
+the root setting, and <code>CONFIG_FALSE</code> otherwise.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005findex"></a>Function: <em>int</em> <strong>config_setting_index</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the index of the given <var>setting</var> within its
+parent setting. If <var>setting</var> is the root setting, this function
+returns -1.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005flength"></a>Function: <em>int</em> <strong>config_setting_length</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the number of settings in a group, or the number of
+elements in a list or array. For other types of settings, it returns
+0.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005ftype"></a>Function: <em>int</em> <strong>config_setting_type</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the type of the given <var>setting</var>. The return
+value is one of the constants
+<code>CONFIG_TYPE_INT</code>, <code>CONFIG_TYPE_INT64</code>, <code>CONFIG_TYPE_FLOAT</code>,
+<code>CONFIG_TYPE_STRING</code>, <code>CONFIG_TYPE_BOOL</code>,
+<code>CONFIG_TYPE_ARRAY</code>, <code>CONFIG_TYPE_LIST</code>, or <code>CONFIG_TYPE_GROUP</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fis_005fgroup"></a>Function: <em>int</em> <strong>config_setting_is_group</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fis_005farray"></a>Function: <em>int</em> <strong>config_setting_is_array</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fis_005flist"></a>Function: <em>int</em> <strong>config_setting_is_list</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These convenience functions, which are implemented as macros, test if
+the setting <var>setting</var> is of a given type. They return
+<code>CONFIG_TRUE</code> or <code>CONFIG_FALSE</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fis_005faggregate"></a>Function: <em>int</em> <strong>config_setting_is_aggregate</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fis_005fscalar"></a>Function: <em>int</em> <strong>config_setting_is_scalar</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fis_005fnumber"></a>Function: <em>int</em> <strong>config_setting_is_number</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<a name="index-aggregate-value"></a>
+<p>These convenience functions, some of which are implemented as macros, test if
+the setting <var>setting</var> is of an aggregate type (a group, array, or
+list), of a scalar type (integer, 64-bit integer, floating point,
+boolean, or string), and of a number (integer, 64-bit integer, or
+floating point), respectively. They return <code>CONFIG_TRUE</code> or
+<code>CONFIG_FALSE</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fsource_005ffile"></a>Function: <em>const char *</em> <strong>config_setting_source_file</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the name of the file from which the setting
+<var>setting</var> was read, or NULL if the setting was not read from a
+file. This information is useful for reporting application-level
+errors. Storage for the returned string is managed by the library and
+released automatically when the configuration is destroyed; the
+string must not be freed by the caller.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fsource_005fline"></a>Function: <em>unsigned int</em> <strong>config_setting_source_line</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This function returns the line number of the configuration file or
+stream at which the setting <var>setting</var> was read, or 0 if no line
+number is available. This information is useful for reporting
+application-level errors.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fset_005fhook"></a>Function: <em>void</em> <strong>config_set_hook</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, void&nbsp;*&nbsp;<var>hook</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fget_005fhook"></a>Function: <em>void *</em> <strong>config_get_hook</strong> <em>(const&nbsp;<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<a name="index-hook"></a>
+<p>These functions make it possible to attach arbitrary data to a configuration
+structure, for instance a &ldquo;wrapper&rdquo; or &ldquo;peer&rdquo; object written in
+another programming language.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fsetting_005fset_005fhook"></a>Function: <em>void</em> <strong>config_setting_set_hook</strong> <em>(<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->, void&nbsp;*&nbsp;<var>hook</var><!-- /@w -->)</em></dt>
+<dt><a name="index-config_005fsetting_005fget_005fhook"></a>Function: <em>void *</em> <strong>config_setting_get_hook</strong> <em>(const&nbsp;<span class="nolinebreak">config_setting_t</span>&nbsp;*&nbsp;<var>setting</var><!-- /@w -->)</em></dt>
+<dd>
+<a name="index-hook-1"></a>
+<p>These functions make it possible to attach arbitrary data to each
+setting structure, for instance a &ldquo;wrapper&rdquo; or &ldquo;peer&rdquo; object written in
+another programming language. The destructor function, if one has been
+supplied via a call to <code>config_set_destructor()</code>, will be called
+by the library to dispose of this data when the setting itself is
+destroyed. There is no default destructor.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-config_005fset_005fdestructor"></a>Function: <em>void</em> <strong>config_set_destructor</strong> <em>(<span class="nolinebreak">config_t</span>&nbsp;*&nbsp;<var>config</var><!-- /@w -->, void&nbsp;(*&nbsp;<var>destructor</var>)(void&nbsp;*)<!-- /@w -->)</em></dt>
+<dd>
+<a name="index-destructor-function"></a>
+<p>This function assigns the destructor function <var>destructor</var> for the
+configuration <var>config</var>. This function accepts a single <code>void
+*</code> argument and has no return value. See
+<code>config_setting_set_hook()</code> above for more information.
+</p>
+</dd></dl>
+
+<hr>
+<a name="The-C_002b_002b-API"></a>
+<div class="header">
+<p>
+Next: <a href="#Example-Programs" accesskey="n" rel="next">Example Programs</a>, Previous: <a href="#The-C-API" accesskey="p" rel="prev">The C API</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="The-C_002b_002b-API-1"></a>
+<h2 class="chapter">4 The C++ API</h2>
+
+<a name="index-Config"></a>
+<a name="index-Setting"></a>
+<p>This chapter describes the C++ library API. The class <code>Config</code>
+represents a configuration, and the class <code>Setting</code> represents a
+configuration setting. Note that by design, neither of these classes
+provides a public copy constructor or assignment operator. Therefore,
+instances of these classes may only be passed between functions via
+references or pointers.
+</p>
+<a name="index-ConfigException"></a>
+<p>The library defines a group of exceptions, all of which extend the
+common base exception <code>ConfigException</code>.
+</p>
+<a name="index-SettingTypeException"></a>
+<p>A <code>SettingTypeException</code> is thrown when the type of a setting&rsquo;s
+value does not match the type requested.
+</p>
+<dl>
+<dt><a name="index-SettingTypeException-on-SettingTypeException"></a>Method on SettingTypeException: <em></em> <strong>SettingTypeException</strong> <em>(const&nbsp;Setting&nbsp;&amp;<var>setting</var><!-- /@w -->)</em></dt>
+<dt><a name="index-SettingTypeException-on-SettingTypeException-1"></a>Method on SettingTypeException: <em></em> <strong>SettingTypeException</strong> <em>(const&nbsp;Setting&nbsp;&amp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dt><a name="index-SettingTypeException-on-SettingTypeException-2"></a>Method on SettingTypeException: <em></em> <strong>SettingTypeException</strong> <em>(const&nbsp;Setting&nbsp;&amp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods construct <code>SettingTypeException</code> objects for the given <var>setting</var> and/or member <var>index</var> or <var>name</var>.
+</p>
+</dd></dl>
+
+<a name="index-SettingNotFoundException"></a>
+<p>A <code>SettingNotFoundException</code> is thrown when a setting is not found.
+</p>
+<dl>
+<dt><a name="index-SettingNotFoundException-on-SettingNotFoundException"></a>Method on SettingNotFoundException: <em></em> <strong>SettingNotFoundException</strong> <em>(const&nbsp;Setting&nbsp;&amp;<var>setting</var><!-- /@w -->, int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dt><a name="index-SettingNotFoundException-on-SettingNotFoundException-1"></a>Method on SettingNotFoundException: <em></em> <strong>SettingNotFoundException</strong> <em>(const&nbsp;Setting&nbsp;&amp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->)</em></dt>
+<dt><a name="index-SettingNotFoundException-on-SettingNotFoundException-2"></a>Method on SettingNotFoundException: <em></em> <strong>SettingNotFoundException</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods construct <code>SettingTypeException</code> objects for the given <var>setting</var> and member <var>index</var> or <var>name</var>, or path <var>path</var>.
+</p>
+</dd></dl>
+
+<a name="index-SettingNameException"></a>
+<p>A <code>SettingNameException</code> is thrown when an attempt is made to add
+a new setting with a non-unique or invalid name.
+</p>
+<dl>
+<dt><a name="index-SettingNameException-on-SettingNameException"></a>Method on SettingNameException: <em></em> <strong>SettingNameException</strong> <em>(const&nbsp;Setting&nbsp;&amp;<var>setting</var><!-- /@w -->, const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This method constructs a <code>SettingNameExcpetion</code> object for the given <var>setting</var> and member name <var>name</var>.
+</p>
+</dd></dl>
+
+<a name="index-ParseException"></a>
+<p>A <code>ParseException</code> is thrown when a parse error occurs while
+reading a configuration from a stream.
+</p>
+<dl>
+<dt><a name="index-ParseException-on-ParseException"></a>Method on ParseException: <em></em> <strong>ParseException</strong> <em>(const&nbsp;char&nbsp;*<var>file</var><!-- /@w -->, int&nbsp;<var>line</var><!-- /@w -->, const&nbsp;char&nbsp;*<var>error</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This method constructs a <code>ParseException</code> object with the given filename <var>file</var>, line number <var>line</var>, and error message <var>error</var>.
+</p>
+</dd></dl>
+
+<a name="index-FileIOException"></a>
+<p>A <code>FileIOException</code> is thrown when an I/O error occurs while
+reading/writing a configuration from/to a file.
+</p>
+<a name="index-SettingException"></a>
+<p><code>SettingTypeException</code>, <code>SettingNotFoundException</code>, and
+<code>SettingNameException</code> all extend the common base
+exception <code>SettingException</code>, which provides the following method:
+</p>
+<dl>
+<dt><a name="index-getPath-on-SettingException"></a>Method on SettingException: <em>const char *</em> <strong>getPath</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the path to the setting associated with the exception, or
+<code>NULL</code> if there is no applicable path.
+</p>
+</dd></dl>
+
+<p>The remainder of this chapter describes the methods for manipulating
+configurations and configuration settings.
+</p>
+<dl>
+<dt><a name="index-Config-on-Config"></a>Method on Config: <em></em> <strong>Config</strong> <em>()</em></dt>
+<dt><a name="index-_007eConfig-on-Config"></a>Method on Config: <em></em> <strong>~Config</strong> <em>()</em></dt>
+<dd>
+<p>These methods create and destroy <code>Config</code> objects.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-clear-on-Config"></a>Method on Config: <em>void</em> <strong>clear</strong> <em>()</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<p>This method clears the configuration. All child settings of the root
+setting are recursively destroyed. All other attributes of the
+configuration are left unchanged.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-read-on-Config"></a>Method on Config: <em>void</em> <strong>read</strong> <em>(FILE&nbsp;*&nbsp;<var>stream</var><!-- /@w -->)</em></dt>
+<dt><a name="index-write-on-Config"></a>Method on Config: <em>void</em> <strong>write</strong> <em>(FILE&nbsp;*&nbsp;<var>stream</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>The <code>read()</code> method reads and parses a configuration from the given
+<var>stream</var>. A <code>ParseException</code> is thrown if a parse error occurs.
+</p>
+<p>The <code>write()</code> method writes the configuration to the given <var>stream</var>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-readFile-on-Config"></a>Method on Config: <em>void</em> <strong>readFile</strong> <em>(const&nbsp;char&nbsp;*&nbsp;<var>filename</var><!-- /@w -->)</em></dt>
+<dt><a name="index-writeFile-on-Config"></a>Method on Config: <em>void</em> <strong>writeFile</strong> <em>(const&nbsp;char&nbsp;*&nbsp;<var>filename</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>The <code>readFile()</code> method reads and parses a configuration from the
+file named <var>filename</var>. A <code>ParseException</code> is thrown if a
+parse error occurs. A <code>FileIOException</code> is thrown if the file
+cannot be read.
+</p>
+<p>The <code>writeFile()</code> method writes the configuration to the file
+named <var>filename</var>. A <code>FileIOException</code> is thrown if the file cannot
+be written.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-readString-on-Config"></a>Method on Config: <em>void</em> <strong>readString</strong> <em>(const&nbsp;char&nbsp;*&nbsp;<var>str</var><!-- /@w -->)</em></dt>
+<dt><a name="index-readString-on-Config-1"></a>Method on Config: <em>void</em> <strong>readString</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>str</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods read and parse a configuration from the string
+<var>str</var>. A <code>ParseException</code> is thrown if a parse error occurs.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getError-on-ParseException"></a>Method on ParseException: <em>const char *</em> <strong>getError</strong> <em>() const</em></dt>
+<dt><a name="index-getFile-on-ParseException"></a>Method on ParseException: <em>const char *</em> <strong>getFile</strong> <em>() const</em></dt>
+<dt><a name="index-getLine-on-ParseException"></a>Method on ParseException: <em>int</em> <strong>getLine</strong> <em>() const</em></dt>
+<dd>
+<p>If a call to <code>readFile()</code>, <code>readString()</code>, or <code>read()</code>
+resulted in a <code>ParseException</code>, these methods can be called on
+the exception object to obtain the text, filename, and line number of
+the parse error. Storage for the strings returned by <code>getError()</code>
+and <code>getFile()</code> are managed by the library; the strings must not
+be freed by the caller.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-setIncludeDir-on-Config"></a>Method on Config: <em>void</em> <strong>setIncludeDir</strong> <em>(const&nbsp;char&nbsp;*<var>includeDir</var><!-- /@w -->)</em></dt>
+<dt><a name="index-getIncludeDir-on-Config"></a>Method on Config: <em>const char *</em> <strong>getIncludeDir</strong> <em>() const</em></dt>
+<dd>
+<p>The <code>setIncludeDir()</code> method specifies the include directory,
+<var>includeDir</var>, relative to which the files specified in
+&lsquo;<samp>@include</samp>&rsquo; directives will be located for the configuration. By
+default, there is no include directory, and all include files are
+expected to be relative to the current working directory. If
+<var>includeDir</var> is <code>NULL</code>, the default behavior is reinstated.
+</p>
+<p>For example, if the include directory is set to <samp>/usr/local/etc</samp>,
+the include directive &lsquo;<samp>@include &quot;configs/extra.cfg&quot;</samp>&rsquo; would include the
+file <samp>/usr/local/etc/configs/extra.cfg</samp>.
+</p>
+<p><code>getIncludeDir()</code> returns the current include directory for the
+configuration, or <code>NULL</code> if none is set.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-evaluateIncludePath-on-Config"></a>Method on Config: <em>virtual const char **</em> <strong>evaluateIncludePath</strong> <em>(const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->, const&nbsp;char&nbsp;**&nbsp;<var>error</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<p>This method is called to evaluate the path of an <code>@include</code> directive.
+The <var>path</var> is the literal path argument of the directive. The method may
+be overridden in a subclass to perform tasks like wildcard expansion and
+variable substitution.
+</p>
+<p>On success, the method should return a <code>NULL</code>-terminated array of paths.
+Any relative paths must be relative to the program&rsquo;s current working directory.
+The contents of these files will be inlined at the point of inclusion, in the
+order that the paths appear in the array. Both the array and its elements should
+be heap allocated; the library will take ownership of and eventually free the
+strings in the array and the array itself.
+</p>
+<p>On failure, the function should return <code>NULL</code> and set <var>*error</var> to a
+static error string which should be used as the parse error for the
+configuration; the library does not take ownership of or free this string.
+</p>
+<p>The default implementation simply returns a <code>NULL</code>-terminated array
+containing either a copy of <var>path</var> if it&rsquo;s an absolute path, or a
+concatenation of the include directory and <var>path</var> if it&rsquo;s a relative path.
+</p>
+<p>For more information see <code>config_set_include_func()</code> above.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getOptions-on-Config"></a>Method on Config: <em>int</em> <strong>getOptions</strong> <em>() const</em></dt>
+<dt><a name="index-setOptions-on-Config"></a>Method on Config: <em>void</em> <strong>setOptions</strong> <em>(int <var>options</var>)</em></dt>
+<dd>
+<a name="index-Config_003a_003aOption"></a>
+<p>These methods get and set the options for the configuration. The
+options affect how configurations are read and written. The parameter
+<var>options</var> should be a bitwise-OR of the following <var>Config::Option</var>
+enumeration values:
+</p>
+<dl compact="compact">
+<dt><code>Config::OptionAutoConvert</code></dt>
+<dd><p>Turning this option on enables number auto-conversion for
+the configuration. When this feature is enabled, an attempt to retrieve a
+floating point setting&rsquo;s value into an integer (or vice versa), or
+store an integer to a floating point setting&rsquo;s value (or vice versa)
+will cause the library to silently perform the necessary conversion
+(possibly leading to loss of data), rather than reporting failure. By
+default this option is turned off.
+</p>
+</dd>
+<dt><code>Config::OptionSemicolonSeparators</code></dt>
+<dd><p>This option controls whether a semicolon (&lsquo;;&rsquo;) is output after each setting
+when the configuration is written to a file or stream. (The semicolon
+separators are optional in the configuration syntax.) By default this
+option is turned on.
+</p>
+</dd>
+<dt><code>Config::OptionColonAssignmentForGroups</code></dt>
+<dd><p>This option controls whether a colon (&lsquo;:&rsquo;) is output between each
+group setting&rsquo;s name and its value when the configuration is written to
+a file or stream. If the option is turned off, an equals sign (&lsquo;=&rsquo;) is
+output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned on.
+</p>
+</dd>
+<dt><code>Config::OptionColonAssignmentForNonGroups</code></dt>
+<dd><p>This option controls whether a colon (&lsquo;:&rsquo;) is output between each
+non-group setting&rsquo;s name and its value when the configuration is written
+to a file or stream. If the option is turned off, an equals sign (&lsquo;=&rsquo;)
+is output instead. (These tokens are interchangeable in the configuration
+syntax.) By default this option is turned off.
+</p>
+</dd>
+<dt><code>Config::OptionOpenBraceOnSeparateLine</code></dt>
+<dd><p>This option controls whether an open brace (&lsquo;{&rsquo;) will be written on its own
+line when the configuration is written to a file or stream. If the option is
+turned off, the brace will be written at the end of the previous line.
+By default this option is turned on.
+</p>
+</dd>
+<dt><code>Config::OptionAllowScientificNotation</code></dt>
+<dd><p>(<b>Since <i>v1.7</i></b>)
+This option controls whether scientific notation may be used as appropriate
+when writing floating point values (corresponding to <code>printf()</code>
+&lsquo;<samp>%g</samp>&rsquo; format) or should never be used (corresponding to <code>printf()</code>
+&lsquo;<samp>%f</samp>&rsquo; format). By default this option is turned off.
+</p>
+</dd>
+<dt><code>Config::OptionFsync</code></dt>
+<dd><p>(<b>Since <i>v1.7.1</i></b>)
+This option controls whether the <code>writeFile()</code> method performs an <i>fsync</i>
+operation after writing the configuration and before closing the file. By
+default this option is turned off.
+</p>
+</dd>
+</dl>
+
+</dd></dl>
+
+<dl>
+<dt><a name="index-getOption-on-Config"></a>Method on Config: <em>bool</em> <strong>getOption</strong> <em>(Config::Option&nbsp;<var>option</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-setOption-on-Config"></a>Method on Config: <em>void</em> <strong>setOption</strong> <em>(Config::Option&nbsp;<var>option</var><!-- /@w -->, bool&nbsp;<var>flag</var><!-- /@w -->)</em></dt>
+<dd>
+<p><b>Since <i>v1.7</i></b>
+</p>
+<p>These methods get and set the option <var>option</var> for the configuration. The
+option is enabled if <var>flag</var> is <code>true</code> and disabled if it is
+<code>false</code>.
+</p>
+<p>See <code>setOptions()</code> above for the list of available options.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getAutoConvert-on-Config"></a>Method on Config: <em>bool</em> <strong>getAutoConvert</strong> <em>() const</em></dt>
+<dt><a name="index-setAutoConvert-on-Config"></a>Method on Config: <em>void</em> <strong>setAutoConvert</strong> <em>(bool <var>flag</var>)</em></dt>
+<dd>
+<p>These methods get and set the <code>OptionAutoConvert</code> option. They
+are obsoleted by the <code>setOption()</code> and <code>getOption()</code>
+methods described above.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getDefaultFormat-on-Config"></a>Method on Config: <em>Setting::Format</em> <strong>getDefaultFormat</strong> <em>() const</em></dt>
+<dt><a name="index-setDefaultFormat-on-Config"></a>Method on Config: <em>void</em> <strong>setDefaultFormat</strong> <em>(Setting::Format&nbsp;<var>format</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods get and set the default external format for settings in
+the configuration. If a non-default format has not been set for a
+setting with <code>Setting::setFormat()</code>, this configuration-wide
+default format will be used instead when that setting is written to a
+file or stream.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getTabWidth-on-Config"></a>Method on Config: <em>unsigned short</em> <strong>getTabWidth</strong> <em>() const</em></dt>
+<dt><a name="index-setTabWidth-on-Config"></a>Method on Config: <em>void</em> <strong>setTabWidth</strong> <em>(unsigned&nbsp;short&nbsp;<var>width</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods get and set the tab width for the configuration. The tab
+width affects the formatting of the configuration when it is written
+to a file or stream: each level of nesting is indented by <var>width</var>
+spaces, or by a single tab character if <var>width</var> is 0. The tab
+width has no effect on parsing.
+</p>
+<p>Valid tab widths range from 0 to 15. The default tab width is 2.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getFloatPrecision-on-Config"></a>Method on Config: <em>unsigned short</em> <strong>getFloatPrecision</strong> <em>() const</em></dt>
+<dt><a name="index-setFloatPrecision-on-Config"></a>Method on Config: <em>void</em> <strong>setFloatPrecision</strong> <em>(unsigned&nbsp;short&nbsp;<var>width</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods get and set the float precision for the configuration.
+This parameter influences the formatting of floating point settings in
+the configuration when it is written to a file or stream.
+Float precision has no effect on parsing.
+</p>
+<p>Valid precisions range from 0 to about 15 (implementation dependent),
+though the library will accept and store values up to 255.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getRoot-on-Config"></a>Method on Config: <em>Setting &amp;</em> <strong>getRoot</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the root setting for the configuration, which is a group.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-lookup-on-Config"></a>Method on Config: <em>Setting &amp;</em> <strong>lookup</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookup-on-Config-1"></a>Method on Config: <em>Setting &amp;</em> <strong>lookup</strong> <em>(const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>These methods locate the setting specified by the path <var>path</var>. If
+the requested setting is not found, a <code>SettingNotFoundException</code> is
+thrown.
+</p>
+</dd></dl>
+<dl>
+<dt><a name="index-exists-on-Config"></a>Method on Config: <em>bool</em> <strong>exists</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-exists-on-Config-1"></a>Method on Config: <em>bool</em> <strong>exists</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>These methods test if a setting with the given <var>path</var> exists in
+the configuration. They return <code>true</code> if the setting exists, and
+<code>false</code> otherwise. These methods do not throw exceptions.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-lookupValue-on-Config"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, bool&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-1"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, bool&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-2"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-3"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-4"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, unsigned&nbsp;int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-5"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, unsigned&nbsp;int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-6"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-7"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-8"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, float&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-9"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, float&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-10"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, double&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-11"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, double&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-12"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, const&nbsp;char&nbsp;*&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-13"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, const&nbsp;char&nbsp;*&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-14"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>path</var><!-- /@w -->, std::string&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Config-15"></a>Method on Config: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->, std::string&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>These are convenience methods for looking up the value of a setting
+with the given <var>path</var>. If the setting is found and is of an
+appropriate type, the value is stored in <var>value</var> and the method
+returns <code>true</code>. Otherwise, <var>value</var> is left unmodified and the
+method returns <code>false</code>. These methods do not throw exceptions.
+</p>
+<p>Storage for <i>const&nbsp;char&nbsp;*</i><!-- /@w --> values is managed by the library and
+released automatically when the setting is destroyed or when its value
+is changed; the string must not be freed by the caller. For safety and
+convenience, always assigning string values to a <code>std::string</code> is
+suggested.
+</p>
+<p>Since these methods have boolean return values and do not throw
+exceptions, they can be used within boolean logic expressions. The following
+example presents a concise way to look up three values at once and
+perform error handling if any of them are not found or are of the
+wrong type:
+</p>
+<br>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">int var1;
+double var2;
+const char *var3;
+
+if(config.lookupValue(&quot;values.var1&quot;, var1)
+ &amp;&amp; config.lookupValue(&quot;values.var2&quot;, var2)
+ &amp;&amp; config.lookupValue(&quot;values.var3&quot;, var3))
+{
+ // use var1, var2, var3
+}
+else
+{
+ // error handling here
+}
+</pre></div>
+</td></tr></table>
+
+<p>This approach also takes advantage of the short-circuit evaluation rules
+of C++, e.g., if the first lookup fails (returning <code>false</code>), the
+remaining lookups are skipped entirely.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-operator-bool-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator bool ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-int-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator int ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-unsigned-int-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator unsigned int ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-long-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator long ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-unsigned-long-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator unsigned long ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-long-long-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator long long ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-unsigned-long-long-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator unsigned long long ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-float-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator float ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-double-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator double ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-const-char-_002a-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator const char * ()</strong> <em>const</em></dt>
+<dt><a name="index-operator-std_003a_003astring-_0028_0029-on-Setting"></a>Method on Setting: <em></em> <strong>operator std::string ()</strong> <em>const</em></dt>
+<dt><a name="index-c_005fstr-on-Setting"></a>Method on Setting: <em>const char *</em> <strong>c_str</strong> <em>() const</em></dt>
+<dd>
+<p>These cast operators allow a <code>Setting</code> object to be assigned to a
+variable of type <i>bool</i> if it is of type <code>TypeBoolean</code>;
+<i>int</i>, <i>unsigned int</i>; <code>long long</code> or <code>unsigned long long</code> if
+it is of type <code>TypeInt64</code>, <i>float</i> or <i>double</i> if it is of type
+<code>TypeFloat</code>; or <i>const&nbsp;char&nbsp;*</i><!-- /@w --> or <i>std::string</i> if it is
+of type <code>TypeString</code>.
+</p>
+<p>Values of type <code>TypeInt</code> or <code>TypeInt64</code> may be assigned to
+variables of type <i>long</i>, or <i>unsigned long</i>, depending on the
+sizes of those types on the host system.
+</p>
+<p>Storage for <i>const&nbsp;char&nbsp;*</i><!-- /@w --> return values is managed by the
+library and released automatically when the setting is destroyed or
+when its value is changed; the string must not be freed by the
+caller. For safety and convenience, always assigning string return
+values to a <code>std::string</code> is suggested.
+</p>
+<p>The following examples demonstrate this usage:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">long width = config.lookup(&quot;application.window.size.w&quot;);
+
+bool splashScreen = config.lookup(&quot;application.splash_screen&quot;);
+
+std::string title = config.lookup(&quot;application.window.title&quot;);
+</pre></div>
+</td></tr></table>
+
+<p>Note that certain conversions can lead to loss of precision or
+clipping of values, e.g., assigning a negative value to an <i>unsigned
+int</i> (in which case the value will be treated as 0), or a
+double-precision value to a <i>float</i>. The library does not treat
+these lossy conversions as errors.
+</p>
+<p>Perhaps surprisingly, the following code in particular will cause a
+compiler error:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">std::string title;
+.
+.
+.
+title = config.lookup(&quot;application.window.title&quot;);
+</pre></div>
+</td></tr></table>
+
+<p>This is because the assignment operator of <code>std::string</code> is being
+invoked with a <code>Setting &amp;</code> as an argument. The compiler is unable
+to make an implicit conversion because both the <code>const char *</code>
+and the <code>std::string</code> cast operators of <code>Setting</code> are
+equally appropriate. This is not a bug in <i>libconfig</i>; providing
+only the <code>const char *</code> cast operator would resolve this
+particular ambiguity, but would cause assignments to
+<code>std::string</code> like the one in the previous example to produce a
+compiler error. (To understand why, see section 11.4.1 of <i>The C++
+Programming Language</i>.)
+</p>
+<p>The solution to this problem is to use an explicit conversion that
+avoids the construction of an intermediate <code>std::string</code> object,
+as follows:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">std::string title;
+.
+.
+.
+title = (const char *)config.lookup(&quot;application.window.title&quot;);
+</pre></div>
+</td></tr></table>
+
+<p>Or, alternatively, use the <code>c_str()</code> method, which has the same effect:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">std::string title;
+.
+.
+.
+title = config.lookup(&quot;application.window.title&quot;).c_str();
+</pre></div>
+</td></tr></table>
+
+<p>If the assignment is invalid due to a type mismatch, a
+<code>SettingTypeException</code> is thrown.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-operator_003d-on-Setting"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(bool&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-1"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(int&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-2"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(long&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-3"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(const&nbsp;long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-4"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(float&nbsp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-5"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(const&nbsp;double&nbsp;&amp;<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-6"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(const&nbsp;char&nbsp;*<var>value</var><!-- /@w -->)</em></dt>
+<dt><a name="index-operator_003d-on-Setting-7"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator=</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>value</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These assignment operators allow values of type <i>bool</i>, <i>int</i>,
+<i>long</i>, <i>long long</i>, <i>float</i>, <i>double</i>, <i>const char *</i>, and
+<i>std::string</i> to be assigned to a setting. In the case of strings,
+the library makes a copy of the passed string <var>value</var>, so it may
+be subsequently freed or modified by the caller without affecting the
+value of the setting.
+</p>
+<p>The following example code looks up a (presumably) integer setting
+and changes its value:
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">Setting &amp;setting = config.lookup(&quot;application.window.size.w&quot;);
+setting = 1024;
+</pre></div>
+</td></tr></table>
+
+<p>If the assignment is invalid due to a type mismatch, a
+<code>SettingTypeException</code> is thrown.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-operator_005b_005d-on-Setting"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator[]</strong> <em>(int&nbsp;<var>index</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-operator_005b_005d-on-Setting-1"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator[]</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-operator_005b_005d-on-Setting-2"></a>Method on Setting: <em>Setting &amp;</em> <strong>operator[]</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>A <code>Setting</code> object may be subscripted with an integer index
+<var>index</var> if it is an array or list, or with either a string
+<var>name</var> or an integer index <var>index</var> if it is a group. For example,
+the following code would produce the string &lsquo;<samp>Last Name</samp>&rsquo; when
+applied to the example configuration in <a href="#Configuration-Files">Configuration Files</a>.
+</p>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">Setting&amp; setting = config.lookup(&quot;application.misc&quot;);
+const char *s = setting[&quot;columns&quot;][0];
+</pre></div>
+</td></tr></table>
+
+<p>If the setting is not an array, list, or group, a
+<code>SettingTypeException</code> is thrown. If the subscript (<var>index</var>
+or <var>name</var>) does not refer to a valid element, a
+<code>SettingNotFoundException</code> is thrown.
+</p>
+<p>Iterating over a group&rsquo;s child settings with an integer index will
+return the settings in the same order that they appear in the
+configuration.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-lookup-on-Setting"></a>Method on Setting: <em>Setting &amp;</em> <strong>lookup</strong> <em>(const&nbsp;char&nbsp;*&nbsp;<var>path</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookup-on-Setting-1"></a>Method on Setting: <em>Setting &amp;</em> <strong>lookup</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>path</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>These methods locate a setting by a path <var>path</var> relative to
+this setting. If requested setting is not found, a
+<code>SettingNotFoundException</code> is thrown.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-lookupValue-on-Setting"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, bool&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-1"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, bool&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-2"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-3"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-4"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, unsigned&nbsp;int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-5"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, unsigned&nbsp;int&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-6"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-7"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-8"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, unsigned&nbsp;long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-9"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, unsigned&nbsp;long&nbsp;long&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-10"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, float&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-11"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, float&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-12"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, double&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-13"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, double&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-14"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, const&nbsp;char&nbsp;*&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-15"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, const&nbsp;char&nbsp;*&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-16"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, std::string&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-lookupValue-on-Setting-17"></a>Method on Setting: <em>bool</em> <strong>lookupValue</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, std::string&nbsp;&amp;<var>value</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>These are convenience methods for looking up the value of a child setting
+with the given <var>name</var>. If the setting is found and is of an
+appropriate type, the value is stored in <var>value</var> and the method
+returns <code>true</code>. Otherwise, <var>value</var> is left unmodified and the
+method returns <code>false</code>. These methods do not throw exceptions.
+</p>
+<p>Storage for <i>const&nbsp;char&nbsp;*</i><!-- /@w --> values is managed by the library and
+released automatically when the setting is destroyed or when its value
+is changed; the string must not be freed by the caller. For safety and
+convenience, always assigning string values to a <code>std::string</code> is
+suggested.
+</p>
+<p>Since these methods have boolean return values and do not throw
+exceptions, they can be used within boolean logic expressions. The following
+example presents a concise way to look up three values at once and
+perform error handling if any of them are not found or are of the
+wrong type:
+</p>
+<br>
+<table class="cartouche" border="1"><tr><td>
+<div class="smallexample">
+<pre class="smallexample">int var1;
+double var2;
+const char *var3;
+
+if(setting.lookupValue(&quot;var1&quot;, var1)
+ &amp;&amp; setting.lookupValue(&quot;var2&quot;, var2)
+ &amp;&amp; setting.lookupValue(&quot;var3&quot;, var3))
+{
+ // use var1, var2, var3
+}
+else
+{
+ // error handling here
+}
+</pre></div>
+</td></tr></table>
+
+<p>This approach also takes advantage of the short-circuit evaluation
+rules of C++, e.g., if the first lookup fails (returning <code>false</code>), the
+remaining lookups are skipped entirely.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-add-on-Setting"></a>Method on Setting: <em>Setting &amp;</em> <strong>add</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->, Setting::Type&nbsp;<var>type</var><!-- /@w -->)</em></dt>
+<dt><a name="index-add-on-Setting-1"></a>Method on Setting: <em>Setting &amp;</em> <strong>add</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->, Setting::Type&nbsp;<var>type</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods add a new child setting with the given <var>name</var> and
+<var>type</var> to the setting, which must be a group. They return a
+reference to the new setting. If the setting already has a child
+setting with the given name, or if the name is invalid, a
+<code>SettingNameException</code> is thrown. If the setting is not a group,
+a <code>SettingTypeException</code> is thrown.
+</p>
+<p>Once a setting has been created, neither its name nor type can be
+changed.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-add-on-Setting-2"></a>Method on Setting: <em>Setting &amp;</em> <strong>add</strong> <em>(Setting::Type&nbsp;<var>type</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This method adds a new element to the setting, which must be of type
+<code>TypeArray</code> or <code>TypeList</code>. If the setting is an array which
+currently has zero elements, the <var>type</var> parameter (which must be
+<code>TypeInt</code>, <code>TypeInt64</code>, <code>TypeFloat</code>, <code>TypeBool</code>,
+or <code>TypeString</code>) determines the type for the array; otherwise it
+must match the type of the existing elements in the array.
+</p>
+<p>The method returns the new setting on success. If <var>type</var> is a
+scalar type, the new setting will have a default value of 0, 0.0,
+<code>false</code>, or <code>NULL</code>, as appropriate.
+</p>
+<p>The method throws a <code>SettingTypeException</code> if the setting is not
+an array or list, or if <var>type</var> is invalid.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-remove-on-Setting"></a>Method on Setting: <em>void</em> <strong>remove</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->)</em></dt>
+<dt><a name="index-remove-on-Setting-1"></a>Method on Setting: <em>void</em> <strong>remove</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods remove the child setting with the given <var>name</var> from
+the setting, which must be a group. Any child settings of the removed
+setting are recursively destroyed as well.
+</p>
+<p>If the setting is not a group, a <code>SettingTypeException</code> is
+thrown. If the setting does not have a child setting with the given
+name, a <code>SettingNotFoundException</code> is thrown.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-remove-on-Setting-2"></a>Method on Setting: <em>void</em> <strong>remove</strong> <em>(unsigned&nbsp;int&nbsp;<var>index</var><!-- /@w -->)</em></dt>
+<dd>
+<p>This method removes the child setting at the given index <var>index</var> from
+the setting, which must be a group, list, or array. Any child settings
+of the removed setting are recursively destroyed as well.
+</p>
+<p>If the setting is not a group, list, or array, a
+<code>SettingTypeException</code> is thrown. If <var>index</var> is out of range,
+a <code>SettingNotFoundException</code> is thrown.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getName-on-Setting"></a>Method on Setting: <em>const char *</em> <strong>getName</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the name of the setting, or <code>NULL</code> if the
+setting has no name. Storage for the returned string is managed by the
+library and released automatically when the setting is destroyed; the
+string must not be freed by the caller. For safety and convenience,
+consider assigning the return value to a <code>std::string</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getPath-on-Setting"></a>Method on Setting: <em>std::string</em> <strong>getPath</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the complete dot-separated path to the
+setting. Settings which do not have a name (list and array elements)
+are represented by their index in square brackets.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getParent-on-Setting"></a>Method on Setting: <em>Setting &amp;</em> <strong>getParent</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the parent setting of the setting. If the setting
+is the root setting, a <code>SettingNotFoundException</code> is thrown.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-isRoot-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isRoot</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns <code>true</code> if the setting is the root setting, and
+<code>false</code> otherwise.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getIndex-on-Setting"></a>Method on Setting: <em>int</em> <strong>getIndex</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the index of the setting within its parent
+setting. When applied to the root setting, this method returns -1.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getType-on-Setting"></a>Method on Setting: <em>Setting::Type</em> <strong>getType</strong> <em>() const</em></dt>
+<dd>
+<a name="index-Setting_003a_003aType"></a>
+<p>This method returns the type of the setting. The
+<code>Setting::Type</code> enumeration consists of the following constants:
+<code>TypeInt</code>, <code>TypeInt64</code>, <code>TypeFloat</code>, <code>TypeString</code>,
+<code>TypeBoolean</code>, <code>TypeArray</code>, <code>TypeList</code>, and
+<code>TypeGroup</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getFormat-on-Setting"></a>Method on Setting: <em>Setting::Format</em> <strong>getFormat</strong> <em>() const</em></dt>
+<dt><a name="index-setFormat-on-Setting"></a>Method on Setting: <em>void</em> <strong>setFormat</strong> <em>(Setting::Format&nbsp;<var>format</var><!-- /@w -->)</em></dt>
+<dd>
+<p>These methods get and set the external format for the setting.
+</p>
+<a name="index-Setting_003a_003aFormat"></a>
+<p>The <var>Setting::Format</var> enumeration consists of the following
+constants: <code>FormatDefault</code> and <code>FormatHex</code>. All settings
+support the <code>FormatDefault</code> format. The <code>FormatHex</code> format
+specifies hexadecimal formatting for integer values, and hence only
+applies to settings of type <code>TypeInt</code> and <code>TypeInt64</code>. If
+<var>format</var> is invalid for the given setting, it is ignored.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-exists-on-Setting"></a>Method on Setting: <em>bool</em> <strong>exists</strong> <em>(const&nbsp;std::string&nbsp;&amp;<var>name</var><!-- /@w -->) const</em></dt>
+<dt><a name="index-exists-on-Setting-1"></a>Method on Setting: <em>bool</em> <strong>exists</strong> <em>(const&nbsp;char&nbsp;*<var>name</var><!-- /@w -->) const</em></dt>
+<dd>
+<p>These methods test if the setting has a child setting with the given
+<var>name</var>. They return <code>true</code> if the setting exists, and
+<code>false</code> otherwise. These methods do not throw exceptions.
+</p>
+</dd></dl>
+<dl>
+<dt><a name="index-begin-on-Setting"></a>Method on Setting: <em>iterator</em> <strong>begin</strong> <em>()</em></dt>
+<dt><a name="index-end-on-Setting"></a>Method on Setting: <em>iterator</em> <strong>end</strong> <em>()</em></dt>
+<dt><a name="index-begin-on-Setting-1"></a>Method on Setting: <em>const_iterator</em> <strong>begin</strong> <em>()</em></dt>
+<dt><a name="index-end-on-Setting-1"></a>Method on Setting: <em>const_iterator</em> <strong>end</strong> <em>()</em></dt>
+<dd>
+<p>These methods return STL-style iterators that can be used to enumerate
+the child settings of a given setting. If the setting is not an array, list,
+or group, they throw a <code>SettingTypeException</code>.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getLength-on-Setting"></a>Method on Setting: <em>int</em> <strong>getLength</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the number of settings in a group, or the number of
+elements in a list or array. For other types of settings, it returns
+0.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-isGroup-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isGroup</strong> <em>() const</em></dt>
+<dt><a name="index-isArray-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isArray</strong> <em>() const</em></dt>
+<dt><a name="index-isList-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isList</strong> <em>() const</em></dt>
+<dd>
+<p>These convenience methods test if a setting is of a given type.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-isAggregate-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isAggregate</strong> <em>() const</em></dt>
+<dt><a name="index-isScalar-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isScalar</strong> <em>() const</em></dt>
+<dt><a name="index-isNumber-on-Setting"></a>Method on Setting: <em>bool</em> <strong>isNumber</strong> <em>() const</em></dt>
+<dd>
+<p>These convenience methods test if a setting is of an aggregate type (a
+group, array, or list), of a scalar type (integer, 64-bit integer,
+floating point, boolean, or string), and of a number (integer, 64-bit
+integer, or floating point), respectively.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getSourceFile-on-Setting"></a>Method on Setting: <em>const char *</em> <strong>getSourceFile</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the name of the file from which the setting was
+read, or NULL if the setting was not read from a file. This
+information is useful for reporting application-level errors. Storage
+for the returned string is managed by the library and released
+automatically when the configuration is destroyed; the string must
+not be freed by the caller.
+</p>
+</dd></dl>
+
+<dl>
+<dt><a name="index-getSourceLine-on-Setting"></a>Method on Setting: <em>unsigned int</em> <strong>getSourceLine</strong> <em>() const</em></dt>
+<dd>
+<p>This method returns the line number of the configuration file or
+stream at which the setting <var>setting</var> was read, or 0 if no line
+number is available. This information is useful for reporting
+application-level errors.
+</p>
+</dd></dl>
+
+<hr>
+<a name="Example-Programs"></a>
+<div class="header">
+<p>
+Next: <a href="#Other-Bindings-and-Implementations" accesskey="n" rel="next">Other Bindings and Implementations</a>, Previous: <a href="#The-C_002b_002b-API" accesskey="p" rel="prev">The C++ API</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Example-Programs-1"></a>
+<h2 class="chapter">5 Example Programs</h2>
+
+<p>Practical example programs that illustrate how to use <i>libconfig</i>
+from both C and C++ are included in the <samp>examples</samp> subdirectory
+of the distribution. These examples include:
+</p>
+<dl compact="compact">
+<dt><samp>examples/c/example1.c</samp></dt>
+<dd><p>An example C program that reads a configuration from an existing file
+<samp>example.cfg</samp> (also located in <samp>examples/c</samp>) and displays
+some of its contents.
+</p>
+</dd>
+<dt><samp>examples/c++/example1.cpp</samp></dt>
+<dd><p>The C++ equivalent of <samp>example1.c</samp>.
+</p>
+</dd>
+<dt><samp>examples/c/example2.c</samp></dt>
+<dd><p>An example C program that reads a configuration from an existing file
+<samp>example.cfg</samp> (also located in <samp>examples/c</samp>), adds new
+settings to the configuration, and writes the updated configuration to
+another file.
+</p>
+</dd>
+<dt><samp>examples/c++/example2.cpp</samp></dt>
+<dd><p>The C++ equivalent of <samp>example2.c</samp>
+</p>
+</dd>
+<dt><samp>examples/c/example3.c</samp></dt>
+<dd><p>An example C program that constructs a new configuration in memory and writes it to a file.
+</p>
+</dd>
+<dt><samp>examples/c++/example3.cpp</samp></dt>
+<dd><p>The C++ equivalent of <samp>example3.c</samp>
+</p>
+</dd>
+<dt><samp>examples/c/example4.c</samp></dt>
+<dd><p>An example C program that uses a custom include function for processing
+wildcard includes. Note that this code will not compile on Windows.
+</p>
+</dd>
+</dl>
+
+<hr>
+<a name="Other-Bindings-and-Implementations"></a>
+<div class="header">
+<p>
+Next: <a href="#License" accesskey="n" rel="next">License</a>, Previous: <a href="#Example-Programs" accesskey="p" rel="prev">Example Programs</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Other-Bindings-and-Implementations-1"></a>
+<h2 class="chapter">6 Other Bindings and Implementations</h2>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top">&bull; <a href="#Bourne-Shell" accesskey="1">Bourne Shell</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#D" accesskey="2">D</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Haskell" accesskey="3">Haskell</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Java" accesskey="4">Java</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Lisp" accesskey="5">Lisp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Perl" accesskey="6">Perl</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Python" accesskey="7">Python</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+<tr><td align="left" valign="top">&bull; <a href="#Ruby" accesskey="8">Ruby</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
+</td></tr>
+</table>
+
+<p>Various open-source libraries have been written that provide access to
+<i>libconfig</i>-style configuration files from other programming languages. Some
+of these libraries are wrappers which add new language bindings for
+<i>libconfig</i> while others are syntax-compatible reimplementations in other
+languages.
+</p>
+<p>Here is a list of some of these implementations.
+</p>
+<hr>
+<a name="Bourne-Shell"></a>
+<div class="header">
+<p>
+Next: <a href="#D" accesskey="n" rel="next">D</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Bourne-Shell-1"></a>
+<h3 class="section">6.1 Bourne Shell</h3>
+
+<p>&#321;ukasz A. Grabowski&rsquo;s <i>ls-config</i> provides a means to read and write
+values in <i>libconfig</i> configuration files from Bourne shell scripts. The
+implementation is included in the <i>libconfig</i> git repository at
+<a href="https://github.com/hyperrealm/libconfig">https://github.com/hyperrealm/libconfig</a>, in the <samp>contrib/ls-config</samp>
+subdirectory.
+</p>
+<hr>
+<a name="D"></a>
+<div class="header">
+<p>
+Next: <a href="#Haskell" accesskey="n" rel="next">Haskell</a>, Previous: <a href="#Bourne-Shell" accesskey="p" rel="prev">Bourne Shell</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="D-1"></a>
+<h3 class="section">6.2 D</h3>
+
+<p>Remi Thebault&rsquo;s <i>libconfig-d</i> is a port of <i>libconfig</i> to the D programming
+language. It may be found at <a href="https://code.dlang.org/packages/libconfig-d">https://code.dlang.org/packages/libconfig-d</a>.
+</p>
+<hr>
+<a name="Haskell"></a>
+<div class="header">
+<p>
+Next: <a href="#Java" accesskey="n" rel="next">Java</a>, Previous: <a href="#D" accesskey="p" rel="prev">D</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Haskell-1"></a>
+<h3 class="section">6.3 Haskell</h3>
+
+<p>Matthew Peddie&rsquo;s <i>libconfig</i> provides Haskell bindings to
+<i>libconfig</i>. It may be found at
+<a href="https://hackage.haskell.org/package/libconfig-0.3.0.0">https://hackage.haskell.org/package/libconfig-0.3.0.0</a>.
+</p>
+<hr>
+<a name="Java"></a>
+<div class="header">
+<p>
+Next: <a href="#Lisp" accesskey="n" rel="next">Lisp</a>, Previous: <a href="#Haskell" accesskey="p" rel="prev">Haskell</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Java-1"></a>
+<h3 class="section">6.4 Java</h3>
+
+<p>Andrey V. Pleskach has a pure-Java implementation of <i>libconfig</i>. It may be
+found on github at <a href="https://github.com/willyborankin/libconfig">https://github.com/willyborankin/libconfig</a>.
+</p>
+<hr>
+<a name="Lisp"></a>
+<div class="header">
+<p>
+Next: <a href="#Perl" accesskey="n" rel="next">Perl</a>, Previous: <a href="#Java" accesskey="p" rel="prev">Java</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Lisp-1"></a>
+<h3 class="section">6.5 Lisp</h3>
+
+<p>Oleg Shalaev&rsquo;s <i>cl-libconfig</i> provides Common Lisp bindings for <i>libconfig</i>.
+It may be found on github at <a href="https://github.com/chalaev/cl-libconfig">https://github.com/chalaev/cl-libconfig</a>.
+</p>
+<hr>
+<a name="Perl"></a>
+<div class="header">
+<p>
+Next: <a href="#Python" accesskey="n" rel="next">Python</a>, Previous: <a href="#Lisp" accesskey="p" rel="prev">Lisp</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Perl-1"></a>
+<h3 class="section">6.6 Perl</h3>
+
+<p>The <i>Conf::Libconfig</i> module provides Perl bindings for <i>libconfig</i>. It may
+be found on CPAN at <a href="http://search.cpan.org/~cnangel/Conf-Libconfig-0.05/">http://search.cpan.org/~cnangel/Conf-Libconfig-0.05/</a>
+or on github at <a href="https://github.com/cnangel/Conf-Libconfig">https://github.com/cnangel/Conf-Libconfig</a>.
+</p>
+<hr>
+<a name="Python"></a>
+<div class="header">
+<p>
+Next: <a href="#Ruby" accesskey="n" rel="next">Ruby</a>, Previous: <a href="#Perl" accesskey="p" rel="prev">Perl</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Python-1"></a>
+<h3 class="section">6.7 Python</h3>
+
+<p>Heiner Tholen&rsquo;s <i>pylibconfig2</i> is a Python library that is syntax-compatible
+with <i>libconfig</i>. It may be found at
+<a href="https://pypi.python.org/pypi/pylibconfig2/0.1.2">https://pypi.python.org/pypi/pylibconfig2/0.1.2</a>.
+</p>
+<br>
+
+<p>Christian Aichinger&rsquo;s <i>libconf</i> is another pure-Python implementation with a
+more permissive license. It may be found at
+<a href="https://pypi.python.org/pypi/libconf">https://pypi.python.org/pypi/libconf</a> or on github at
+<a href="https://github.com/Grk0/python-libconf">https://github.com/Grk0/python-libconf</a>.
+</p>
+<br>
+
+<p>The <i>python-libconfig</i> wrapper provides Python bindings to <i>libconfig</i>. It
+may be found on github at <a href="https://github.com/cnangel/python-libconfig/">https://github.com/cnangel/python-libconfig/</a>.
+</p>
+<hr>
+<a name="Ruby"></a>
+<div class="header">
+<p>
+Previous: <a href="#Python" accesskey="p" rel="prev">Python</a>, Up: <a href="#Other-Bindings-and-Implementations" accesskey="u" rel="up">Other Bindings and Implementations</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Ruby-1"></a>
+<h3 class="section">6.8 Ruby</h3>
+
+<p>Christopher Mark Gore&rsquo;s <i>ruby-libconfig</i> is a Ruby library that provides Ruby
+bindings for <i>libconfig</i>. It may be found at
+<a href="https://rubygems.org/gems/libconfig">https://rubygems.org/gems/libconfig</a> or on github at
+<a href="https://github.com/cgore/ruby-libconfig">https://github.com/cgore/ruby-libconfig</a>.
+</p>
+<br>
+
+<p>There is also another Ruby wrapper, <i>libconfig-ruby</i>, that is included in
+the <i>libconfig</i> git repository at <a href="https://github.com/hyperrealm/libconfig">https://github.com/hyperrealm/libconfig</a>,
+in the <samp>contrib/libconfig-ruby</samp> subdirectory.
+</p>
+<hr>
+<a name="License"></a>
+<div class="header">
+<p>
+Next: <a href="#Configuration-File-Grammar" accesskey="n" rel="next">Configuration File Grammar</a>, Previous: <a href="#Other-Bindings-and-Implementations" accesskey="p" rel="prev">Other Bindings and Implementations</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="License-1"></a>
+<h2 class="appendix">Appendix A License</h2>
+
+
+
+<div align="center">GNU LESSER GENERAL PUBLIC LICENSE
+</div><div align="center">Version 2.1, February 1999
+</div>
+<br>
+
+<p>Copyright &copy; 1991, 1999 Free Software Foundation, Inc.,
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+</p>
+<p>Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+</p>
+<p>[This is the first released version of the Lesser GPL. It also counts
+as the successor of the GNU Library Public License, version 2, hence the
+version number 2.1.]
+</p>
+<br>
+<div align="center">Preamble
+</div><br>
+
+<p>The licenses for most software are designed to take away your freedom to
+share and change it. By contrast, the GNU General Public Licenses are
+intended to guarantee your freedom to share and change free software&ndash;to
+make sure the software is free for all its users.
+</p>
+<p>This license, the Lesser General Public License, applies to some
+specially designated software packages&ndash;typically libraries&ndash;of the Free
+Software Foundation and other authors who decide to use it. You can use
+it too, but we suggest you first think carefully about whether this
+license or the ordinary General Public License is the better strategy to
+use in any particular case, based on the explanations below.
+</p>
+<p>When we speak of free software, we are referring to freedom of use, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish); that you receive source code or can get it if
+you want it; that you can change the software and use pieces of it in
+new free programs; and that you are informed that you can do these
+things.
+</p>
+<p>To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+</p>
+<p>For example, if you distribute copies of the library, whether gratis or
+for a fee, you must give the recipients all the rights that we gave you.
+You must make sure that they, too, receive or can get the source code.
+If you link other code with the library, you must provide complete
+object files to the recipients, so that they can relink them with the
+library after making changes to the library and recompiling it. And you
+must show them these terms so they know their rights.
+</p>
+<p>We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+</p>
+<p>To protect each distributor, we want to make it very clear that there is
+no warranty for the free library. Also, if the library is modified by
+someone else and passed on, the recipients should know that what they
+have is not the original version, so that the original author&rsquo;s
+reputation will not be affected by problems that might be introduced by
+others.
+</p>
+<p>Finally, software patents pose a constant threat to the existence of any
+free program. We wish to make sure that a company cannot effectively
+restrict the users of a free program by obtaining a restrictive license
+from a patent holder. Therefore, we insist that any patent license
+obtained for a version of the library must be consistent with the full
+freedom of use specified in this license.
+</p>
+<p>Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License. This license, the GNU Lesser General Public
+License, applies to certain designated libraries, and is quite different
+from the ordinary General Public License. We use this license for
+certain libraries in order to permit linking those libraries into
+non-free programs.
+</p>
+<p>When a program is linked with a library, whether statically or using a
+shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the entire
+combination fits its criteria of freedom. The Lesser General Public
+License permits more lax criteria for linking other code with the
+library.
+</p>
+<p>We call this license the &ldquo;Lesser&rdquo; General Public License because it does
+Less to protect the user&rsquo;s freedom than the ordinary General Public
+License. It also provides other free software developers Less of an
+advantage over competing non-free programs. These disadvantages are the
+reason we use the ordinary General Public License for many libraries.
+However, the Lesser license provides advantages in certain special
+circumstances.
+</p>
+<p>For example, on rare occasions, there may be a special need to encourage
+the widest possible use of a certain library, so that it becomes a
+de-facto standard. To achieve this, non-free programs must be allowed
+to use the library. A more frequent case is that a free library does
+the same job as widely used non-free libraries. In this case, there is
+little to gain by limiting the free library to free software only, so we
+use the Lesser General Public License.
+</p>
+<p>In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of free
+software. For example, permission to use the GNU C Library in non-free
+programs enables many more people to use the whole GNU operating system,
+as well as its variant, the GNU/Linux operating system.
+</p>
+<p>Although the Lesser General Public License is Less protective of the
+users&rsquo; freedom, it does ensure that the user of a program that is linked
+with the Library has the freedom and the wherewithal to run that program
+using a modified version of the Library.
+</p>
+<p>The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+&ldquo;work based on the library&rdquo; and a &ldquo;work that uses the library&rdquo;. The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+</p>
+
+<div align="center">GNU LESSER GENERAL PUBLIC LICENSE
+</div><div align="center">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+</div>
+<ol>
+<li>
+<br>
+</li><li> This License Agreement applies to any software library or other program
+which contains a notice placed by the copyright holder or other
+authorized party saying it may be distributed under the terms of this
+Lesser General Public License (also called &ldquo;this License&rdquo;). Each
+licensee is addressed as &ldquo;you&rdquo;.
+
+<p>A &ldquo;library&rdquo; means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+</p>
+<p>The &ldquo;Library&rdquo;, below, refers to any such software library or work which
+has been distributed under these terms. A &ldquo;work based on the Library&rdquo;
+means either the Library or any derivative work under copyright law:
+that is to say, a work containing the Library or a portion of it, either
+verbatim or with modifications and/or translated straightforwardly into
+another language. (Hereinafter, translation is included without
+limitation in the term &ldquo;modification&rdquo;.)
+</p>
+<p>&ldquo;Source code&rdquo; for a work means the preferred form of the work for making
+modifications to it. For a library, complete source code means all the
+source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and
+installation of the library.
+</p>
+<p>Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of running
+a program using the Library is not restricted, and output from such a
+program is covered only if its contents constitute a work based on the
+Library (independent of the use of the Library in a tool for writing
+it). Whether that is true depends on what the Library does and what the
+program that uses the Library does.
+</p>
+<br>
+</li><li> You may copy and distribute verbatim copies of the Library&rsquo;s complete
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the notices
+that refer to this License and to the absence of any warranty; and
+distribute a copy of this License along with the Library.
+
+<p>You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+</p>
+<br>
+</li><li> You may modify your copy or copies of the Library or any portion of it,
+thus forming a work based on the Library, and copy and distribute such
+modifications or work under the terms of Section 1 above, provided that
+you also meet all of these conditions:
+
+<ol>
+<li> The modified work must itself be a software library.
+
+<br>
+</li><li> You must cause the files modified to carry prominent notices stating
+that you changed the files and the date of any change.
+
+<br>
+</li><li> You must cause the whole of the work to be licensed at no charge to all
+third parties under the terms of this License.
+
+<br>
+</li><li> If a facility in the modified Library refers to a function or a table of
+data to be supplied by an application program that uses the facility,
+other than as an argument passed when the facility is invoked, then you
+must make a good faith effort to ensure that, in the event an
+application does not supply such function or table, the facility still
+operates, and performs whatever part of its purpose remains meaningful.
+
+<p>(For example, a function in a library to compute square roots has a
+purpose that is entirely well-defined independent of the application.
+Therefore, Subsection 2d requires that any application-supplied function
+or table used by this function must be optional: if the application does
+not supply it, the square root function must still compute square
+roots.)
+</p>
+</li></ol>
+
+<p>These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library, and
+can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based on
+the Library, the distribution of the whole must be on the terms of this
+License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+</p>
+<p>Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+</p>
+<p>In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of a
+storage or distribution medium does not bring the other work under the
+scope of this License.
+</p>
+<br>
+</li><li> You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so that
+they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+<p>Once this change is made in a given copy, it is irreversible for that
+copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+</p>
+<p>This option is useful when you wish to copy part of the code of the
+Library into a program that is not a library.
+</p>
+<br>
+</li><li> You may copy and distribute the Library (or a portion or derivative of
+it, under Section 2) in object code or executable form under the terms
+of Sections 1 and 2 above provided that you accompany it with the
+complete corresponding machine-readable source code, which must be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange.
+
+<p>If distribution of object code is made by offering access to copy from a
+designated place, then offering equivalent access to copy the source
+code from the same place satisfies the requirement to distribute the
+source code, even though third parties are not compelled to copy the
+source along with the object code.
+</p>
+<br>
+</li><li> A program that contains no derivative of any portion of the Library, but
+is designed to work with the Library by being compiled or linked with
+it, is called a &ldquo;work that uses the Library&rdquo;. Such a work, in
+isolation, is not a derivative work of the Library, and therefore falls
+outside the scope of this License.
+
+<p>However, linking a &ldquo;work that uses the Library&rdquo; with the Library creates
+an executable that is a derivative of the Library (because it contains
+portions of the Library), rather than a &ldquo;work that uses the library&rdquo;.
+The executable is therefore covered by this License. Section 6 states
+terms for distribution of such executables.
+</p>
+<p>When a &ldquo;work that uses the Library&rdquo; uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be linked
+without the Library, or if the work is itself a library. The threshold
+for this to be true is not precisely defined by law.
+</p>
+<p>If such an object file uses only numerical parameters, data structure
+layouts and accessors, and small macros and small inline functions (ten
+lines or less in length), then the use of the object file is
+unrestricted, regardless of whether it is legally a derivative work.
+(Executables containing this object code plus portions of the Library
+will still fall under Section 6.)
+</p>
+<p>Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6, whether
+or not they are linked directly with the Library itself.
+</p>
+<br>
+</li><li> As an exception to the Sections above, you may also combine or link a
+&ldquo;work that uses the Library&rdquo; with the Library to produce a work
+containing portions of the Library, and distribute that work under terms
+of your choice, provided that the terms permit modification of the work
+for the customer&rsquo;s own use and reverse engineering for debugging such
+modifications.
+
+<p>You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+</p>
+<ol>
+<li>
+<br>
+</li><li> Accompany the work with the complete corresponding machine-readable
+source code for the Library including whatever changes were used in the
+work (which must be distributed under Sections 1 and 2 above); and, if
+the work is an executable linked with the Library, with the complete
+machine-readable &ldquo;work that uses the Library&rdquo;, as object code and/or
+source code, so that the user can modify the Library and then relink to
+produce a modified executable containing the modified Library. (It is
+understood that the user who changes the contents of definitions files
+in the Library will not necessarily be able to recompile the application
+to use the modified definitions.)
+
+<br>
+</li><li> Use a suitable shared library mechanism for linking with the Library. A
+suitable mechanism is one that (1) uses at run time a copy of the
+library already present on the user&rsquo;s computer system, rather than
+copying library functions into the executable, and (2) will operate
+properly with a modified version of the library, if the user installs
+one, as long as the modified version is interface-compatible with the
+version that the work was made with.
+
+<br>
+</li><li> Accompany the work with a written offer, valid for at least three years,
+to give the same user the materials specified in Subsection 6a, above,
+for a charge no more than the cost of performing this distribution.
+
+<br>
+</li><li> If distribution of the work is made by offering access to copy from a
+designated place, offer equivalent access to copy the above specified
+materials from the same place.
+
+<br>
+</li><li> Verify that the user has already received a copy of these materials or
+that you have already sent this user a copy.
+
+</li></ol>
+
+<p>For an executable, the required form of the &ldquo;work that uses the Library&rdquo;
+must include any data and utility programs needed for reproducing the
+executable from it. However, as a special exception, the materials to
+be distributed need not include anything that is normally distributed
+(in either source or binary form) with the major components (compiler,
+kernel, and so on) of the operating system on which the executable runs,
+unless that component itself accompanies the executable.
+</p>
+<p>It may happen that this requirement contradicts the license restrictions
+of other proprietary libraries that do not normally accompany the
+operating system. Such a contradiction means you cannot use both them
+and the Library together in an executable that you distribute.
+</p>
+<br>
+</li><li> You may place library facilities that are a work based on the Library
+side-by-side in a single library together with other library facilities
+not covered by this License, and distribute such a combined library,
+provided that the separate distribution of the work based on the Library
+and of the other library facilities is otherwise permitted, and provided
+that you do these two things:
+
+<ol>
+<li>
+<br>
+</li><li> Accompany the combined library with a copy of the same work based on the
+Library, uncombined with any other library facilities. This must be
+distributed under the terms of the Sections above.
+
+<br>
+</li><li> Give prominent notice with the combined library of the fact that part of
+it is a work based on the Library, and explaining where to find the
+accompanying uncombined form of the same work.
+
+</li></ol>
+
+<br>
+</li><li> You may not copy, modify, sublicense, link with, or distribute the
+Library except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, link with, or distribute the
+Library is void, and will automatically terminate your rights under this
+License. However, parties who have received copies, or rights, from you
+under this License will not have their licenses terminated so long as
+such parties remain in full compliance.
+
+<br>
+</li><li> You are not required to accept this License, since you have not signed
+it. However, nothing else grants you permission to modify or distribute
+the Library or its derivative works. These actions are prohibited by
+law if you do not accept this License. Therefore, by modifying or
+distributing the Library (or any work based on the Library), you
+indicate your acceptance of this License to do so, and all its terms and
+conditions for copying, distributing or modifying the Library or works
+based on it.
+
+<br>
+</li><li> Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients&rsquo; exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+<br>
+</li><li> If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent license
+would not permit royalty-free redistribution of the Library by all those
+who receive copies directly or indirectly through you, then the only way
+you could satisfy both it and this License would be to refrain entirely
+from distribution of the Library.
+
+<p>If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+</p>
+<p>It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is implemented
+by public license practices. Many people have made generous
+contributions to the wide range of software distributed through that
+system in reliance on consistent application of that system; it is up to
+the author/donor to decide if he or she is willing to distribute
+software through any other system and a licensee cannot impose that
+choice.
+</p>
+<p>This section is intended to make thoroughly clear what is believed to be
+a consequence of the rest of this License.
+</p>
+<br>
+</li><li> If the distribution and/or use of the Library is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Library under this License may add an
+explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+<br>
+</li><li> The Free Software Foundation may publish revised and/or new versions of
+the Lesser General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns.
+
+<p>Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and &ldquo;any
+later version&rdquo;, you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a license
+version number, you may choose any version ever published by the Free
+Software Foundation.
+</p>
+<br>
+</li><li> If you wish to incorporate parts of the Library into other free programs
+whose distribution conditions are incompatible with these, write to the
+author to ask for permission. For software which is copyrighted by the
+Free Software Foundation, write to the Free Software Foundation; we
+sometimes make exceptions for this. Our decision will be guided by the
+two goals of preserving the free status of all derivatives of our free
+software and of promoting the sharing and reuse of software generally.
+
+<br>
+<div align="center">NO WARRANTY
+</div><br>
+
+</li><li> BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE LIBRARY &ldquo;AS IS&rdquo; WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH
+YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+<br>
+</li><li> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
+DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
+DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY
+(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
+THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR
+OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+</li></ol>
+
+<br>
+<div align="center">END OF TERMS AND CONDITIONS
+</div><br>
+<div align="center">How to Apply These Terms to Your New Libraries
+</div>
+<p>If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of
+the ordinary General Public License).
+</p>
+<p>To apply these terms, attach the following notices to the library. It
+is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should have
+at least the &ldquo;copyright&rdquo; line and a pointer to where the full notice is
+found.
+</p>
+<div class="format">
+<pre class="format"><tt>
+&lt;one line to give the library's name and a brief idea of what it does.&gt;
+Copyright (C) &lt;year&gt; &lt;name of author&gt;
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+</tt>
+</pre></div>
+
+<p>Also add information on how to contact you by electronic and paper mail.
+</p>
+<p>You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a &ldquo;copyright disclaimer&rdquo; for the library, if
+necessary. Here is a sample; alter the names:
+</p>
+<div class="format">
+<pre class="format"><tt>
+Yoyodyne, Inc., hereby disclaims all copyright interest in the
+library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+&lt;signature of Ty Coon&gt;, 1 April 1990
+Ty Coon, President of Vice
+</tt>
+</pre></div>
+
+<p>That&rsquo;s all there is to it!
+</p>
+
+<hr>
+<a name="Configuration-File-Grammar"></a>
+<div class="header">
+<p>
+Next: <a href="#Function-Index" accesskey="n" rel="next">Function Index</a>, Previous: <a href="#License" accesskey="p" rel="prev">License</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Configuration-File-Grammar-1"></a>
+<h2 class="appendix">Appendix B Configuration File Grammar</h2>
+
+<p>Below is the BNF grammar for configuration files. Comments and include
+directives are not part of the grammar, so they are not included here.
+</p>
+<br>
+<div class="example">
+<pre class="example">&lt;configuration&gt; ::=
+ &lt;setting-list&gt;
+ | &lt;empty&gt;
+
+&lt;setting-list&gt; ::=
+ &lt;setting&gt;
+ | &lt;setting-list&gt; &lt;setting&gt;
+
+&lt;setting&gt; ::=
+ &lt;name&gt; ( &quot;:&quot; | &quot;=&quot; ) &lt;value&gt; ( &quot;;&quot; | &quot;,&quot; | &lt;empty&gt; )
+
+&lt;value&gt; ::=
+ &lt;scalar-value&gt;
+ | &lt;array&gt;
+ | &lt;list&gt;
+ | &lt;group&gt;
+
+&lt;value-list&gt; ::=
+ &lt;value&gt;
+ | &lt;value-list&gt; &quot;,&quot; &lt;value&gt;
+ | &lt;value-list&gt; &quot;,&quot;
+
+&lt;scalar-value&gt; ::=
+ &lt;boolean&gt;
+ | &lt;integer&gt;
+ | &lt;integer64&gt;
+ | &lt;hex&gt;
+ | &lt;hex64&gt;
+ | &lt;float&gt;
+ | &lt;string&gt;
+
+&lt;scalar-value-list&gt; ::=
+ &lt;scalar-value&gt;
+ | &lt;scalar-value-list&gt; &quot;,&quot; &lt;scalar-value&gt;
+ | &lt;scalar-value-list&gt; &quot;,&quot;
+
+&lt;array&gt; ::=
+ &quot;[&quot; ( &lt;scalar-value-list&gt; | &lt;empty&gt; ) &quot;]&quot;
+
+&lt;list&gt; ::=
+ &quot;(&quot; ( &lt;value-list&gt; | &lt;empty&gt; ) &quot;)&quot;
+
+&lt;group&gt; ::=
+ &quot;{&quot; ( &lt;setting-list&gt; | &lt;empty&gt; ) &quot;}&quot;
+
+&lt;empty&gt; ::=
+</pre></div>
+
+<br>
+<br>
+<p>Terminals are defined below as regular expressions:
+</p><br>
+
+<table>
+<tr><td width="20%"><code>&lt;boolean&gt;</code></td><td width="80%"><code>([Tt][Rr][Uu][Ee])|([Ff][Aa][Ll][Ss][Ee])</code></td></tr>
+<tr><td width="20%"><code>&lt;string&gt;</code></td><td width="80%"><code>\&quot;([^\&quot;\\]|\\.)*\&quot;</code></td></tr>
+<tr><td width="20%"><code>&lt;name&gt;</code></td><td width="80%"><code>[A-Za-z\*][-A-Za-z0-9_\*]*</code></td></tr>
+<tr><td width="20%"><code>&lt;integer&gt;</code></td><td width="80%"><code>[-+]?[0-9]+</code></td></tr>
+<tr><td width="20%"><code>&lt;integer64&gt;</code></td><td width="80%"><code>[-+]?[0-9]+L(L)?</code></td></tr>
+<tr><td width="20%"><code>&lt;hex&gt;</code></td><td width="80%"><code>0[Xx][0-9A-Fa-f]+</code></td></tr>
+<tr><td width="20%"><code>&lt;hex64&gt;</code></td><td width="80%"><code>0[Xx][0-9A-Fa-f]+(L(L)?)?</code></td></tr>
+<tr><td width="20%"><code>&lt;float&gt;</code></td><td width="80%"><code>([-+]?([0-9]*)?\.[0-9]*([eE][-+]?[0-9]+)?)|([-+]([0-9]+)(\.[0-9]*)?[eE][-+]?[0-9]+)</code></td></tr>
+</table>
+
+<br>
+
+<p>Note that adjacent strings are automatically concatenated. Non-printable
+characters can be represented within strings using a sequence &lsquo;<samp>\xx</samp>&rsquo;,
+representing the ASCII value as two hex digits.
+</p>
+<hr>
+<a name="Function-Index"></a>
+<div class="header">
+<p>
+Next: <a href="#Type-Index" accesskey="n" rel="next">Type Index</a>, Previous: <a href="#Configuration-File-Grammar" accesskey="p" rel="prev">Configuration File Grammar</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Function-Index-1"></a>
+<h2 class="unnumbered">Function Index</h2>
+
+<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Function-Index_fn_symbol-1"><b>~</b></a>
+ &nbsp;
+<br>
+<a class="summary-letter" href="#Function-Index_fn_letter-A"><b>A</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-B"><b>B</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-C"><b>C</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-E"><b>E</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-F"><b>F</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-G"><b>G</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-I"><b>I</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-L"><b>L</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-O"><b>O</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-P"><b>P</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-R"><b>R</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-S"><b>S</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-W"><b>W</b></a>
+ &nbsp;
+</td></tr></table>
+<table class="index-fn" border="0">
+<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_symbol-1">~</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-_007eConfig-on-Config"><code>~Config on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-A">A</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-add-on-Setting"><code>add on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-add-on-Setting-1"><code>add on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-add-on-Setting-2"><code>add on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-B">B</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-begin-on-Setting"><code>begin on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-begin-on-Setting-1"><code>begin on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-C">C</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-clear-on-Config"><code>clear on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Config-on-Config"><code>Config on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fclear"><code>config_clear</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fdestroy"><code>config_destroy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005ferror_005ffile"><code>config_error_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005ferror_005fline"><code>config_error_line</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005ferror_005ftext"><code>config_error_text</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005ferror_005ftype"><code>config_error_type</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005fauto_005fconvert"><code>config_get_auto_convert</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005fdefault_005fformat"><code>config_get_default_format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005ffloat_005fprecision_0028config_005ft-_002aconfig_0029"><code>config_get_float_precision(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->)</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005fhook"><code>config_get_hook</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005finclude_005fdir"><code>config_get_include_dir</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005foption"><code>config_get_option</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005foptions"><code>config_get_options</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fget_005ftab_005fwidth"><code>config_get_tab_width</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005finit"><code>config_init</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005flookup"><code>config_lookup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005flookup_005fbool"><code>config_lookup_bool</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005flookup_005ffloat"><code>config_lookup_float</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005flookup_005fint"><code>config_lookup_int</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005flookup_005fint64"><code>config_lookup_int64</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005flookup_005fstring"><code>config_lookup_string</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fread"><code>config_read</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fread_005ffile"><code>config_read_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fread_005fstring"><code>config_read_string</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005froot_005fsetting"><code>config_root_setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fadd"><code>config_setting_add</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fbool"><code>config_setting_get_bool</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fbool_005felem"><code>config_setting_get_bool_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005felem"><code>config_setting_get_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005ffloat"><code>config_setting_get_float</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005ffloat_005felem"><code>config_setting_get_float_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fformat"><code>config_setting_get_format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fhook"><code>config_setting_get_hook</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fint"><code>config_setting_get_int</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fint64"><code>config_setting_get_int64</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fint64_005felem"><code>config_setting_get_int64_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fint_005felem"><code>config_setting_get_int_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fmember"><code>config_setting_get_member</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fstring"><code>config_setting_get_string</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fget_005fstring_005felem"><code>config_setting_get_string_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005findex"><code>config_setting_index</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005faggregate"><code>config_setting_is_aggregate</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005farray"><code>config_setting_is_array</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005fgroup"><code>config_setting_is_group</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005flist"><code>config_setting_is_list</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005fnumber"><code>config_setting_is_number</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005froot"><code>config_setting_is_root</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fis_005fscalar"><code>config_setting_is_scalar</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flength"><code>config_setting_length</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flookup"><code>config_setting_lookup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flookup_005fbool"><code>config_setting_lookup_bool</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flookup_005ffloat"><code>config_setting_lookup_float</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flookup_005fint"><code>config_setting_lookup_int</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flookup_005fint64"><code>config_setting_lookup_int64</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005flookup_005fstring"><code>config_setting_lookup_string</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fname"><code>config_setting_name</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fparent"><code>config_setting_parent</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fremove"><code>config_setting_remove</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fremove_005felem"><code>config_setting_remove_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fbool"><code>config_setting_set_bool</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fbool_005felem"><code>config_setting_set_bool_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005ffloat"><code>config_setting_set_float</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005ffloat_005felem"><code>config_setting_set_float_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fformat"><code>config_setting_set_format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fhook"><code>config_setting_set_hook</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fint"><code>config_setting_set_int</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fint64"><code>config_setting_set_int64</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fint64_005felem"><code>config_setting_set_int64_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fint_005felem"><code>config_setting_set_int_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fstring"><code>config_setting_set_string</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fset_005fstring_005felem"><code>config_setting_set_string_elem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fsource_005ffile"><code>config_setting_source_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005fsource_005fline"><code>config_setting_source_line</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005ftype"><code>config_setting_type</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005fauto_005fconvert"><code>config_set_auto_convert</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005fdefault_005fformat"><code>config_set_default_format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005fdestructor"><code>config_set_destructor</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005ffloat_005fprecision_0028config_005ft-_002aconfig_002c"><code>config_set_float_precision(<span class="nolinebreak">config_t</span>&nbsp;*<var>config</var><!-- /@w -->,</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005fhook"><code>config_set_hook</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005finclude_005fdir"><code>config_set_include_dir</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005finclude_005ffunc"><code>config_set_include_func</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005foption"><code>config_set_option</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005foptions"><code>config_set_options</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fset_005ftab_005fwidth"><code>config_set_tab_width</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fwrite"><code>config_write</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fwrite_005ffile"><code>config_write_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-c_005fstr-on-Setting"><code>c_str on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-E">E</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-end-on-Setting"><code>end on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-end-on-Setting-1"><code>end on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-evaluateIncludePath-on-Config"><code>evaluateIncludePath on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-exists-on-Config"><code>exists on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-exists-on-Config-1"><code>exists on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-exists-on-Setting"><code>exists on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-exists-on-Setting-1"><code>exists on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-F">F</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-func"><code>func</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-G">G</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getAutoConvert-on-Config"><code>getAutoConvert on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getDefaultFormat-on-Config"><code>getDefaultFormat on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getError-on-ParseException"><code>getError on ParseException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getFile-on-ParseException"><code>getFile on ParseException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getFloatPrecision-on-Config"><code>getFloatPrecision on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getFormat-on-Setting"><code>getFormat on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getIncludeDir-on-Config"><code>getIncludeDir on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getIndex-on-Setting"><code>getIndex on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getLength-on-Setting"><code>getLength on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getLine-on-ParseException"><code>getLine on ParseException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getName-on-Setting"><code>getName on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getOption-on-Config"><code>getOption on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getOptions-on-Config"><code>getOptions on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getParent-on-Setting"><code>getParent on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getPath-on-Setting"><code>getPath on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getPath-on-SettingException"><code>getPath on SettingException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getRoot-on-Config"><code>getRoot on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getSourceFile-on-Setting"><code>getSourceFile on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getSourceLine-on-Setting"><code>getSourceLine on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getTabWidth-on-Config"><code>getTabWidth on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-getType-on-Setting"><code>getType on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-I">I</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isAggregate-on-Setting"><code>isAggregate on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isArray-on-Setting"><code>isArray on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isGroup-on-Setting"><code>isGroup on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isList-on-Setting"><code>isList on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isNumber-on-Setting"><code>isNumber on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isRoot-on-Setting"><code>isRoot on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-isScalar-on-Setting"><code>isScalar on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-L">L</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-LIBCONFIGXX_005fVER_005fMAJOR"><code>LIBCONFIGXX_VER_MAJOR</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Version-Test-Macros">Version Test Macros</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-LIBCONFIGXX_005fVER_005fMINOR"><code>LIBCONFIGXX_VER_MINOR</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Version-Test-Macros">Version Test Macros</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-LIBCONFIGXX_005fVER_005fREVISION"><code>LIBCONFIGXX_VER_REVISION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Version-Test-Macros">Version Test Macros</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-LIBCONFIG_005fVER_005fMAJOR"><code>LIBCONFIG_VER_MAJOR</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Version-Test-Macros">Version Test Macros</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-LIBCONFIG_005fVER_005fMINOR"><code>LIBCONFIG_VER_MINOR</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Version-Test-Macros">Version Test Macros</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-LIBCONFIG_005fVER_005fREVISION"><code>LIBCONFIG_VER_REVISION</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Version-Test-Macros">Version Test Macros</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookup-on-Config"><code>lookup on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookup-on-Config-1"><code>lookup on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookup-on-Setting"><code>lookup on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookup-on-Setting-1"><code>lookup on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-1"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-2"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-3"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-4"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-5"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-6"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-7"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-8"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-9"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-10"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-11"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-12"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-13"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-14"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Config-15"><code>lookupValue on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-1"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-2"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-3"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-4"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-5"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-6"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-7"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-8"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-9"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-10"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-11"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-12"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-13"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-14"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-15"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-16"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-lookupValue-on-Setting-17"><code>lookupValue on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-O">O</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-bool-_0028_0029-on-Setting"><code>operator bool () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-const-char-_002a-_0028_0029-on-Setting"><code>operator const char * () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-double-_0028_0029-on-Setting"><code>operator double () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-float-_0028_0029-on-Setting"><code>operator float () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-int-_0028_0029-on-Setting"><code>operator int () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-long-_0028_0029-on-Setting"><code>operator long () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-long-long-_0028_0029-on-Setting"><code>operator long long () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-std_003a_003astring-_0028_0029-on-Setting"><code>operator std::string () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-unsigned-int-_0028_0029-on-Setting"><code>operator unsigned int () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-unsigned-long-_0028_0029-on-Setting"><code>operator unsigned long () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator-unsigned-long-long-_0028_0029-on-Setting"><code>operator unsigned long long () on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-1"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-2"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-3"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-4"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-5"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-6"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_003d-on-Setting-7"><code>operator= on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_005b_005d-on-Setting"><code>operator[] on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_005b_005d-on-Setting-1"><code>operator[] on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-operator_005b_005d-on-Setting-2"><code>operator[] on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-P">P</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-ParseException-on-ParseException"><code>ParseException on ParseException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-R">R</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-read-on-Config"><code>read on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-readFile-on-Config"><code>readFile on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-readString-on-Config"><code>readString on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-readString-on-Config-1"><code>readString on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-remove-on-Setting"><code>remove on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-remove-on-Setting-1"><code>remove on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-remove-on-Setting-2"><code>remove on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-S">S</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setAutoConvert-on-Config"><code>setAutoConvert on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setDefaultFormat-on-Config"><code>setDefaultFormat on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setFloatPrecision-on-Config"><code>setFloatPrecision on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setFormat-on-Setting"><code>setFormat on Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setIncludeDir-on-Config"><code>setIncludeDir on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setOption-on-Config"><code>setOption on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setOptions-on-Config"><code>setOptions on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setTabWidth-on-Config"><code>setTabWidth on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingNameException-on-SettingNameException"><code>SettingNameException on SettingNameException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingNotFoundException-on-SettingNotFoundException"><code>SettingNotFoundException on SettingNotFoundException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingNotFoundException-on-SettingNotFoundException-1"><code>SettingNotFoundException on SettingNotFoundException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingNotFoundException-on-SettingNotFoundException-2"><code>SettingNotFoundException on SettingNotFoundException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingTypeException-on-SettingTypeException"><code>SettingTypeException on SettingTypeException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingTypeException-on-SettingTypeException-1"><code>SettingTypeException on SettingTypeException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingTypeException-on-SettingTypeException-2"><code>SettingTypeException on SettingTypeException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Function-Index_fn_letter-W">W</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-write-on-Config"><code>write on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-writeFile-on-Config"><code>writeFile on Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+</table>
+<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Function-Index_fn_symbol-1"><b>~</b></a>
+ &nbsp;
+<br>
+<a class="summary-letter" href="#Function-Index_fn_letter-A"><b>A</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-B"><b>B</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-C"><b>C</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-E"><b>E</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-F"><b>F</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-G"><b>G</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-I"><b>I</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-L"><b>L</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-O"><b>O</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-P"><b>P</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-R"><b>R</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-S"><b>S</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Function-Index_fn_letter-W"><b>W</b></a>
+ &nbsp;
+</td></tr></table>
+
+<hr>
+<a name="Type-Index"></a>
+<div class="header">
+<p>
+Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Function-Index" accesskey="p" rel="prev">Function Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Type-Index-1"></a>
+<h2 class="unnumbered">Type Index</h2>
+
+<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Type-Index_tp_letter-C"><b>C</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Type-Index_tp_letter-F"><b>F</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Type-Index_tp_letter-P"><b>P</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Type-Index_tp_letter-S"><b>S</b></a>
+ &nbsp;
+</td></tr></table>
+<table class="index-tp" border="0">
+<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Type-Index_tp_letter-C">C</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Config"><code>Config</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Config_003a_003aOption"><code>Config::Option</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-ConfigException"><code>ConfigException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005ferror_005ft"><code>config_error_t</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005finclude_005ffn_005ft"><code>config_include_fn_t</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005fsetting_005ft"><code>config_setting_t</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-config_005ft"><code>config_t</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Type-Index_tp_letter-F">F</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-FileIOException"><code>FileIOException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Type-Index_tp_letter-P">P</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-ParseException"><code>ParseException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Type-Index_tp_letter-S">S</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Setting"><code>Setting</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Setting_003a_003aFormat"><code>Setting::Format</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Setting_003a_003aType"><code>Setting::Type</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingException"><code>SettingException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingFormat"><code>SettingFormat</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingNameException"><code>SettingNameException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingNotFoundException"><code>SettingNotFoundException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-SettingTypeException"><code>SettingTypeException</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C_002b_002b-API">The C++ API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+</table>
+<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Type-Index_tp_letter-C"><b>C</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Type-Index_tp_letter-F"><b>F</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Type-Index_tp_letter-P"><b>P</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Type-Index_tp_letter-S"><b>S</b></a>
+ &nbsp;
+</td></tr></table>
+
+<hr>
+<a name="Concept-Index"></a>
+<div class="header">
+<p>
+Previous: <a href="#Type-Index" accesskey="p" rel="prev">Type Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Function-Index" title="Index" rel="index">Index</a>]</p>
+</div>
+<a name="Concept-Index-1"></a>
+<h2 class="unnumbered">Concept Index</h2>
+
+<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Concept-Index_cp_letter-A"><b>A</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-C"><b>C</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-D"><b>D</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-E"><b>E</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-F"><b>F</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-G"><b>G</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-H"><b>H</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-I"><b>I</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-L"><b>L</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-P"><b>P</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-S"><b>S</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-U"><b>U</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-V"><b>V</b></a>
+ &nbsp;
+</td></tr></table>
+<table class="index-cp" border="0">
+<tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-A">A</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-aggregate-value">aggregate value</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-array">array</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-C">C</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-comment">comment</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Comments">Comments</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-configuration">configuration</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-D">D</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-destructor-function">destructor function</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-E">E</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-escape-sequence">escape sequence</a>:</td><td>&nbsp;</td><td valign="top"><a href="#String-Values">String Values</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-F">F</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-format">format</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-G">G</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-group">group</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-H">H</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-hook">hook</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-hook-1">hook</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-C-API">The C API</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-I">I</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-include-directive">include directive</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Include-Directives">Include Directives</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-include-function">include function</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Include-Directives">Include Directives</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-L">L</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-list">list</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-locale">locale</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Internationalization-Issues">Internationalization Issues</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-P">P</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-path">path</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-pkg_002dconfig">pkg-config</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Compiling-Using-pkg_002dconfig">Compiling Using pkg-config</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-S">S</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-scalar-value">scalar value</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-setting">setting</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-U">U</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-Unicode">Unicode</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Internationalization-Issues">Internationalization Issues</a></td></tr>
+<tr><td></td><td valign="top"><a href="#index-UTF_002d8">UTF-8</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Internationalization-Issues">Internationalization Issues</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th><a name="Concept-Index_cp_letter-V">V</a></th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-value">value</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Configuration-Files">Configuration Files</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+</table>
+<table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Concept-Index_cp_letter-A"><b>A</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-C"><b>C</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-D"><b>D</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-E"><b>E</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-F"><b>F</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-G"><b>G</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-H"><b>H</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-I"><b>I</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-L"><b>L</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-P"><b>P</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-S"><b>S</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-U"><b>U</b></a>
+ &nbsp;
+<a class="summary-letter" href="#Concept-Index_cp_letter-V"><b>V</b></a>
+ &nbsp;
+</td></tr></table>
+
+<hr>
+
+
+
+</body>
+</html>
diff --git a/docs/libconfig_manual.pdf b/docs/libconfig_manual.pdf
new file mode 100644
index 0000000..c3628b3
--- /dev/null
+++ b/docs/libconfig_manual.pdf
Binary files differ
diff --git a/docs/test.cfg.txt b/docs/test.cfg.txt
new file mode 100644
index 0000000..9709c58
--- /dev/null
+++ b/docs/test.cfg.txt
@@ -0,0 +1,78 @@
+#----------------------------
+# Example Configuration File
+#---------------------------
+#
+
+application:
+{
+
+ /* This section defines some settings for our
+ * main application window, such as size and
+ * position.
+ */
+
+ window:
+ {
+ title = "My Application";
+ size = { /* width */ w = 640; /* height */ h = 480; };
+ pos = { x = 350; y = 250; };
+ };
+
+ a = 5;
+ b = 6;
+ ff = 1E6;
+ test-comment = "/* hello\n \"there\"*/";
+
+ test-long-string = "A very long string that spans multiple lines. "
+ /* but wait, there's more... */ "Adjacent strings are automatically"
+ " concatenated.";
+
+ test-escaped-string = "\"This is\n a test.\"";
+
+ group1:
+ {
+ x = 5; y = 10;
+ my_array = [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ];
+ flag = TRUE;
+
+ group2: { zzz = "this is a test"; };
+
+ states = [ "CT", // Connecticut
+ "CA", // California
+ "TX", // Texas
+ "NV", // Nevada
+ "FL" // Florida
+ ];
+ };
+
+ /* this would cause an error */
+ // a = "hi!";
+};
+
+binary = [ 0xAA, 0xBB, 0xCC ];
+
+list = ( ( "abc", 123, true ), 1.234, ( /* an empty list */ ) ,[ 1, 2, 3 ],
+ { a = (1, 2, true); } );
+
+books = ( "inventory",
+ { title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.99;
+ qty = 5; },
+ { title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8; },
+ { } );
+
+# miscellaneous stuff
+
+misc:
+{
+ pi = 3.141592653589793238;
+ bitmask = 0xAABBCCDD;
+ bigint = 9223372036854775807L;
+ unicode = "STARGΛ̊TE SG-1"; // UTF-8 string
+};
+
+### eof
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..129e7c0
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(c)
+add_subdirectory(c++) \ No newline at end of file
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..e084bf0
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,6 @@
+
+SUBDIRS = c
+
+if BUILDCXX
+SUBDIRS += c++
+endif
diff --git a/examples/c++/CMakeLists.txt b/examples/c++/CMakeLists.txt
new file mode 100644
index 0000000..6452e39
--- /dev/null
+++ b/examples/c++/CMakeLists.txt
@@ -0,0 +1,20 @@
+if(CMAKE_HOST_WIN32)
+ set(libname "libconfig")
+else()
+ set(libname "config")
+endif()
+
+add_executable(c++_example1 example1.cpp )
+add_executable(c++_example2 example2.cpp )
+add_executable(c++_example3 example3.cpp )
+add_executable(c++_example4 example4.cpp )
+
+target_include_directories(c++_example1 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+target_include_directories(c++_example2 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+target_include_directories(c++_example3 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+target_include_directories(c++_example4 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+
+target_link_libraries(c++_example1 ${libname}++ )
+target_link_libraries(c++_example2 ${libname}++ )
+target_link_libraries(c++_example3 ${libname}++ )
+target_link_libraries(c++_example4 ${libname}++ )
diff --git a/examples/c++/Makefile.am b/examples/c++/Makefile.am
new file mode 100644
index 0000000..46b66d0
--- /dev/null
+++ b/examples/c++/Makefile.am
@@ -0,0 +1,16 @@
+
+check_PROGRAMS = example1 example2 example3 example4
+AM_DEFAULT_SOURCE_EXT = .cpp
+
+noinst_PROGRAMS=$(check_PROGRAMS)
+TESTS = $(check_PROGRAMS)
+XFAIL_TESTS = example4
+
+AM_CPPFLAGS = -I $(top_srcdir)/lib
+
+LDADD = $(top_builddir)/lib/libconfig++.la
+
+EXTRA_DIST = \
+ example.cfg invalid.cfg \
+ *.vcproj \
+ *.vcxproj
diff --git a/examples/c++/cxx_example1.vcproj b/examples/c++/cxx_example1.vcproj
new file mode 100644
index 0000000..0a9207f
--- /dev/null
+++ b/examples/c++/cxx_example1.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c++_example1"
+ ProjectGUID="{A1DF518C-A515-45A3-9B67-7D49F616DECC}"
+ RootNamespace="cxx_example1"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example1.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\example.cfg"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c++/cxx_example1.vcxproj b/examples/c++/cxx_example1.vcxproj
new file mode 100644
index 0000000..2554593
--- /dev/null
+++ b/examples/c++/cxx_example1.vcxproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c++_example1</ProjectName>
+ <ProjectGuid>{A1DF518C-A515-45A3-9B67-7D49F616DECC}</ProjectGuid>
+ <RootNamespace>cxx_example1</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example1.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig++.vcxproj">
+ <Project>{a0c36ce7-d908-4573-8b69-249eeeb7d2be}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example1.vcxproj.filters b/examples/c++/cxx_example1.vcxproj.filters
new file mode 100644
index 0000000..2a8831a
--- /dev/null
+++ b/examples/c++/cxx_example1.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{26fe1b3c-05f2-4642-a72e-1c48b8114e7e}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{19fa267f-5e54-45ca-b3cd-1e6df82693bf}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{78e18572-bfe5-42b7-b442-2739f89bfadd}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example1.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example2.vcproj b/examples/c++/cxx_example2.vcproj
new file mode 100644
index 0000000..9b0f7fc
--- /dev/null
+++ b/examples/c++/cxx_example2.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c++_example2"
+ ProjectGUID="{DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}"
+ RootNamespace="cxx_example2"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example2.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\example.cfg"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c++/cxx_example2.vcxproj b/examples/c++/cxx_example2.vcxproj
new file mode 100644
index 0000000..21e7f22
--- /dev/null
+++ b/examples/c++/cxx_example2.vcxproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c++_example2</ProjectName>
+ <ProjectGuid>{DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}</ProjectGuid>
+ <RootNamespace>cxx_example2</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example2.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig++.vcxproj">
+ <Project>{a0c36ce7-d908-4573-8b69-249eeeb7d2be}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example2.vcxproj.filters b/examples/c++/cxx_example2.vcxproj.filters
new file mode 100644
index 0000000..f57a2ab
--- /dev/null
+++ b/examples/c++/cxx_example2.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{26e3067e-e422-4912-9ccc-454c6f6b2386}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{4a7f2694-43e3-4b68-9fe4-9116dea409dc}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{d6cc89fc-71fb-4079-8880-d5929671a8c5}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example2.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example3.vcproj b/examples/c++/cxx_example3.vcproj
new file mode 100644
index 0000000..8c85b98
--- /dev/null
+++ b/examples/c++/cxx_example3.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c++_example3"
+ ProjectGUID="{8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}"
+ RootNamespace="cxx_example3"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example3.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\example.cfg"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c++/cxx_example3.vcxproj b/examples/c++/cxx_example3.vcxproj
new file mode 100644
index 0000000..e35965f
--- /dev/null
+++ b/examples/c++/cxx_example3.vcxproj
@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c++_example3</ProjectName>
+ <ProjectGuid>{8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}</ProjectGuid>
+ <RootNamespace>cxx_example3</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example3.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig++.vcxproj">
+ <Project>{a0c36ce7-d908-4573-8b69-249eeeb7d2be}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example3.vcxproj.filters b/examples/c++/cxx_example3.vcxproj.filters
new file mode 100644
index 0000000..e020cb8
--- /dev/null
+++ b/examples/c++/cxx_example3.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{08871e44-8537-4831-94b0-0c5242f5b2e3}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{dc4fc0e3-21da-4a8d-93a2-37d97afc0863}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{a7a7fe30-554c-4d06-8eb9-6d1572ddfec3}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example3.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example4.vcproj b/examples/c++/cxx_example4.vcproj
new file mode 100644
index 0000000..ad452ae
--- /dev/null
+++ b/examples/c++/cxx_example4.vcproj
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c++_example4"
+ ProjectGUID="{F631BE25-B384-4061-B7D1-E0C0E77D3A0C}"
+ RootNamespace="cxx_example4"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example4.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c++/cxx_example4.vcxproj b/examples/c++/cxx_example4.vcxproj
new file mode 100644
index 0000000..7ab9d57
--- /dev/null
+++ b/examples/c++/cxx_example4.vcxproj
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c++_example4</ProjectName>
+ <ProjectGuid>{F631BE25-B384-4061-B7D1-E0C0E77D3A0C}</ProjectGuid>
+ <RootNamespace>cxx_example4</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>Default</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIGXX_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>Default</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c++\invalid.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example4.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig++.vcxproj">
+ <Project>{a0c36ce7-d908-4573-8b69-249eeeb7d2be}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/cxx_example4.vcxproj.filters b/examples/c++/cxx_example4.vcxproj.filters
new file mode 100644
index 0000000..eda6f98
--- /dev/null
+++ b/examples/c++/cxx_example4.vcxproj.filters
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{5671aa1d-f0df-4c26-af66-cefdf2b07d1b}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{9536c93b-425e-4d98-9d36-c00ba6555416}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{1cfcab1f-afaf-4e07-96df-ec2b07d63131}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example4.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c++/example.cfg b/examples/c++/example.cfg
new file mode 100644
index 0000000..8f11dc6
--- /dev/null
+++ b/examples/c++/example.cfg
@@ -0,0 +1,46 @@
+// An example configuration file that stores information about a store.
+
+// Basic store information:
+name = "Books, Movies & More";
+
+// Store inventory:
+inventory =
+{
+ books = ( { title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.99;
+ qty = 5; },
+ { title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8; }
+ );
+
+ movies = ( { title = "Brazil";
+ media = "DVD";
+ price = 19.99;
+ qty = 11; },
+ { title = "The City of Lost Children";
+ media = "DVD";
+ price = 18.99;
+ qty = 5; },
+ { title = "Memento";
+ media = "Blu-Ray";
+ price = 24.99;
+ qty = 20;
+ },
+ { title = "Howard the Duck"; }
+ );
+};
+
+// Store hours:
+hours =
+{
+ mon = { open = 9; close = 18; };
+ tue = { open = 9; close = 18; };
+ wed = { open = 9; close = 18; };
+ thu = { open = 9; close = 18; };
+ fri = { open = 9; close = 20; };
+ sat = { open = 9; close = 20; };
+ sun = { open = 11; close = 16; };
+};
diff --git a/examples/c++/example1.cpp b/examples/c++/example1.cpp
new file mode 100644
index 0000000..1fb5ff6
--- /dev/null
+++ b/examples/c++/example1.cpp
@@ -0,0 +1,151 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2010 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include <libconfig.h++>
+
+using namespace std;
+using namespace libconfig;
+
+// This example reads the configuration file 'example.cfg' and displays
+// some of its contents.
+
+int main(int argc, char **argv)
+{
+ Config cfg;
+
+ // Read the file. If there is an error, report it and exit.
+ try
+ {
+ cfg.readFile("example.cfg");
+ }
+ catch(const FileIOException &fioex)
+ {
+ std::cerr << "I/O error while reading file." << std::endl;
+ return(EXIT_FAILURE);
+ }
+ catch(const ParseException &pex)
+ {
+ std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine()
+ << " - " << pex.getError() << std::endl;
+ return(EXIT_FAILURE);
+ }
+
+ // Get the store name.
+ try
+ {
+ string name = cfg.lookup("name");
+ cout << "Store name: " << name << endl << endl;
+ }
+ catch(const SettingNotFoundException &nfex)
+ {
+ cerr << "No 'name' setting in configuration file." << endl;
+ }
+
+ const Setting& root = cfg.getRoot();
+
+ // Output a list of all books in the inventory.
+ try
+ {
+ const Setting &books = root["inventory"]["books"];
+ int count = books.getLength();
+
+ cout << setw(30) << left << "TITLE" << " "
+ << setw(30) << left << "AUTHOR" << " "
+ << setw(6) << left << "PRICE" << " "
+ << "QTY"
+ << endl;
+
+ for(int i = 0; i < count; ++i)
+ {
+ const Setting &book = books[i];
+
+ // Only output the record if all of the expected fields are present.
+ string title, author;
+ double price;
+ int qty;
+
+ if(!(book.lookupValue("title", title)
+ && book.lookupValue("author", author)
+ && book.lookupValue("price", price)
+ && book.lookupValue("qty", qty)))
+ continue;
+
+ cout << setw(30) << left << title << " "
+ << setw(30) << left << author << " "
+ << '$' << setw(6) << right << price << " "
+ << qty
+ << endl;
+ }
+ cout << endl;
+ }
+ catch(const SettingNotFoundException &nfex)
+ {
+ // Ignore.
+ }
+
+ // Output a list of all books in the inventory.
+ try
+ {
+ const Setting &movies = root["inventory"]["movies"];
+ int count = movies.getLength();
+
+ cout << setw(30) << left << "TITLE" << " "
+ << setw(10) << left << "MEDIA" << " "
+ << setw(6) << left << "PRICE" << " "
+ << "QTY"
+ << endl;
+
+ for(int i = 0; i < count; ++i)
+ {
+ const Setting &movie = movies[i];
+
+ // Only output the record if all of the expected fields are present.
+ string title, media;
+ double price;
+ int qty;
+
+ if(!(movie.lookupValue("title", title)
+ && movie.lookupValue("media", media)
+ && movie.lookupValue("price", price)
+ && movie.lookupValue("qty", qty)))
+ continue;
+
+ cout << setw(30) << left << title << " "
+ << setw(10) << left << media << " "
+ << '$' << setw(6) << right << price << " "
+ << qty
+ << endl;
+ }
+ cout << endl;
+ }
+ catch(const SettingNotFoundException &nfex)
+ {
+ // Ignore.
+ }
+
+ return(EXIT_SUCCESS);
+}
+
+// eof
diff --git a/examples/c++/example2.cpp b/examples/c++/example2.cpp
new file mode 100644
index 0000000..13f862c
--- /dev/null
+++ b/examples/c++/example2.cpp
@@ -0,0 +1,102 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2010 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include <libconfig.h++>
+
+using namespace std;
+using namespace libconfig;
+
+// This example reads the configuration file 'example.cfg', adds a new
+// movie record to the movies list, and writes the updated configuration to
+// 'updated.cfg'.
+
+int main(int argc, char **argv)
+{
+ static const char *output_file = "updated.cfg";
+
+ Config cfg;
+
+ cfg.setOptions(Config::OptionFsync
+ | Config::OptionSemicolonSeparators
+ | Config::OptionColonAssignmentForGroups
+ | Config::OptionOpenBraceOnSeparateLine);
+
+ // Read the file. If there is an error, report it and exit.
+ try
+ {
+ cfg.readFile("example.cfg");
+ }
+ catch(const FileIOException &fioex)
+ {
+ std::cerr << "I/O error while reading file." << std::endl;
+ return(EXIT_FAILURE);
+ }
+ catch(const ParseException &pex)
+ {
+ std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine()
+ << " - " << pex.getError() << std::endl;
+ return(EXIT_FAILURE);
+ }
+
+ // Find the 'movies' setting. Add intermediate settings if they don't yet
+ // exist.
+ Setting &root = cfg.getRoot();
+
+ if(! root.exists("inventory"))
+ root.add("inventory", Setting::TypeGroup);
+
+ Setting &inventory = root["inventory"];
+
+ if(! inventory.exists("movies"))
+ inventory.add("movies", Setting::TypeList);
+
+ Setting &movies = inventory["movies"];
+
+ // Create the new movie entry.
+ Setting &movie = movies.add(Setting::TypeGroup);
+
+ movie.add("title", Setting::TypeString) = "Buckaroo Banzai";
+ movie.add("media", Setting::TypeString) = "DVD";
+ movie.add("price", Setting::TypeFloat) = 12.99;
+ movie.add("qty", Setting::TypeInt) = 20;
+
+ // Write out the updated configuration.
+ try
+ {
+ cfg.writeFile(output_file);
+ cerr << "Updated configuration successfully written to: " << output_file
+ << endl;
+
+ }
+ catch(const FileIOException &fioex)
+ {
+ cerr << "I/O error while writing file: " << output_file << endl;
+ return(EXIT_FAILURE);
+ }
+
+ return(EXIT_SUCCESS);
+}
+
+// eof
diff --git a/examples/c++/example3.cpp b/examples/c++/example3.cpp
new file mode 100644
index 0000000..da5caf5
--- /dev/null
+++ b/examples/c++/example3.cpp
@@ -0,0 +1,71 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2010 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include <libconfig.h++>
+
+using namespace std;
+using namespace libconfig;
+
+// This example constructs a new configuration in memory and writes it to
+// 'newconfig.cfg'.
+
+int main(int argc, char **argv)
+{
+ static const char *output_file = "newconfig.cfg";
+ Config cfg;
+
+ Setting &root = cfg.getRoot();
+
+ // Add some settings to the configuration.
+ Setting &address = root.add("address", Setting::TypeGroup);
+
+ address.add("street", Setting::TypeString) = "1 Woz Way";
+ address.add("city", Setting::TypeString) = "San Jose";
+ address.add("state", Setting::TypeString) = "CA";
+ address.add("zip", Setting::TypeInt) = 95110;
+
+ Setting &array = root.add("array", Setting::TypeArray);
+
+ for(int i = 0; i < 10; ++i)
+ array.add(Setting::TypeInt) = 10 * i;
+
+ // Write out the new configuration.
+ try
+ {
+ cfg.writeFile(output_file);
+ cerr << "New configuration successfully written to: " << output_file
+ << endl;
+
+ }
+ catch(const FileIOException &fioex)
+ {
+ cerr << "I/O error while writing file: " << output_file << endl;
+ return(EXIT_FAILURE);
+ }
+
+ return(EXIT_SUCCESS);
+}
+
+// eof
diff --git a/examples/c++/example4.cpp b/examples/c++/example4.cpp
new file mode 100644
index 0000000..b23f4c5
--- /dev/null
+++ b/examples/c++/example4.cpp
@@ -0,0 +1,57 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2010 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <iostream>
+#include <iomanip>
+#include <cstdlib>
+#include <libconfig.h++>
+
+using namespace std;
+using namespace libconfig;
+
+// This example demonstrates the handling of parsing errors in
+// 'invalid.cfg'.
+
+int main(int argc, char **argv)
+{
+ Config cfg;
+
+ try
+ {
+ cfg.readFile("invalid.cfg");
+ }
+ catch(const FileIOException &fioex)
+ {
+ std::cerr << "File I/O error" << std::endl;
+ return(EXIT_FAILURE);
+ }
+ catch(const ParseException &pex)
+ {
+ std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine()
+ << " - " << pex.getError() << std::endl;
+ return(EXIT_FAILURE);
+ }
+
+ return(EXIT_SUCCESS);
+}
+
+// eof
diff --git a/examples/c++/invalid.cfg b/examples/c++/invalid.cfg
new file mode 100644
index 0000000..764b44d
--- /dev/null
+++ b/examples/c++/invalid.cfg
@@ -0,0 +1,8 @@
+// An example configuration file with an invalid @include.
+
+
+pi = 3.141592654;
+
+@include "missing.cfg"
+
+e = 2.718281828;
diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt
new file mode 100644
index 0000000..ea5e774
--- /dev/null
+++ b/examples/c/CMakeLists.txt
@@ -0,0 +1,17 @@
+if(CMAKE_HOST_WIN32)
+ set(libname "libconfig")
+else()
+ set(libname "config")
+endif()
+
+add_executable(c_example1 example1.c )
+add_executable(c_example2 example2.c )
+add_executable(c_example3 example3.c )
+
+target_include_directories(c_example1 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+target_include_directories(c_example2 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+target_include_directories(c_example3 PRIVATE ${CMAKE_SOURCE_DIR}/lib)
+
+target_link_libraries(c_example1 ${libname} )
+target_link_libraries(c_example2 ${libname} )
+target_link_libraries(c_example3 ${libname} )
diff --git a/examples/c/Makefile.am b/examples/c/Makefile.am
new file mode 100644
index 0000000..18172a8
--- /dev/null
+++ b/examples/c/Makefile.am
@@ -0,0 +1,17 @@
+
+check_PROGRAMS = example1 example2 example3 example4
+noinst_PROGRAMS=$(check_PROGRAMS)
+
+TESTS = $(check_PROGRAMS)
+
+AM_CPPFLAGS = -I $(top_srcdir)/lib
+
+LDADD = $(top_builddir)/lib/libconfig.la
+
+EXTRA_DIST = \
+ example.cfg \
+ example4.cfg \
+ cfg_includes/*.cfg \
+ cfg_includes/cfg_subincludes/*.cfg \
+ *.vcproj \
+ *.vcxproj
diff --git a/examples/c/cfg_includes/book1.cfg b/examples/c/cfg_includes/book1.cfg
new file mode 100644
index 0000000..6ccd5a6
--- /dev/null
+++ b/examples/c/cfg_includes/book1.cfg
@@ -0,0 +1,6 @@
+{
+ title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.99;
+ qty = 5;
+},
diff --git a/examples/c/cfg_includes/book2.cfg b/examples/c/cfg_includes/book2.cfg
new file mode 100644
index 0000000..a38176e
--- /dev/null
+++ b/examples/c/cfg_includes/book2.cfg
@@ -0,0 +1,6 @@
+{
+ title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8;
+},
diff --git a/examples/c/cfg_includes/book3.cfg b/examples/c/cfg_includes/book3.cfg
new file mode 100644
index 0000000..ebf5f05
--- /dev/null
+++ b/examples/c/cfg_includes/book3.cfg
@@ -0,0 +1,6 @@
+{
+ title = "Farnham's Freehold";
+ author = "Robert A. Heinlein";
+ price = 4.99;
+ qty = 4;
+},
diff --git a/examples/c/cfg_includes/book4.cfg b/examples/c/cfg_includes/book4.cfg
new file mode 100644
index 0000000..394015e
--- /dev/null
+++ b/examples/c/cfg_includes/book4.cfg
@@ -0,0 +1,9 @@
+{
+ title = "Ubik";
+ author = "Philip K. Dick";
+ price = 7.50;
+ qty = 5;
+ list = (1,2,3,);
+ array = [1,2,3,4,5,6,];
+ @include "cfg_includes/cfg_subincludes/*.cfg"
+},
diff --git a/examples/c/cfg_includes/cfg_subincludes/extra1.cfg b/examples/c/cfg_includes/cfg_subincludes/extra1.cfg
new file mode 100644
index 0000000..34d96cc
--- /dev/null
+++ b/examples/c/cfg_includes/cfg_subincludes/extra1.cfg
@@ -0,0 +1 @@
+extra1 = "bar";
diff --git a/examples/c/cfg_includes/cfg_subincludes/extra2.cfg b/examples/c/cfg_includes/cfg_subincludes/extra2.cfg
new file mode 100644
index 0000000..244fb14
--- /dev/null
+++ b/examples/c/cfg_includes/cfg_subincludes/extra2.cfg
@@ -0,0 +1 @@
+extra2 = 12345;
diff --git a/examples/c/cfg_includes/other.cfg b/examples/c/cfg_includes/other.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/c/cfg_includes/other.cfg
diff --git a/examples/c/example.cfg b/examples/c/example.cfg
new file mode 100644
index 0000000..8f11dc6
--- /dev/null
+++ b/examples/c/example.cfg
@@ -0,0 +1,46 @@
+// An example configuration file that stores information about a store.
+
+// Basic store information:
+name = "Books, Movies & More";
+
+// Store inventory:
+inventory =
+{
+ books = ( { title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.99;
+ qty = 5; },
+ { title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8; }
+ );
+
+ movies = ( { title = "Brazil";
+ media = "DVD";
+ price = 19.99;
+ qty = 11; },
+ { title = "The City of Lost Children";
+ media = "DVD";
+ price = 18.99;
+ qty = 5; },
+ { title = "Memento";
+ media = "Blu-Ray";
+ price = 24.99;
+ qty = 20;
+ },
+ { title = "Howard the Duck"; }
+ );
+};
+
+// Store hours:
+hours =
+{
+ mon = { open = 9; close = 18; };
+ tue = { open = 9; close = 18; };
+ wed = { open = 9; close = 18; };
+ thu = { open = 9; close = 18; };
+ fri = { open = 9; close = 20; };
+ sat = { open = 9; close = 20; };
+ sun = { open = 11; close = 16; };
+};
diff --git a/examples/c/example1.c b/examples/c/example1.c
new file mode 100644
index 0000000..0c7b5b4
--- /dev/null
+++ b/examples/c/example1.c
@@ -0,0 +1,115 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <libconfig.h>
+
+/* This example reads the configuration file 'example.cfg' and displays
+ * some of its contents.
+ */
+
+int main(int argc, char **argv)
+{
+ config_t cfg;
+ config_setting_t *setting;
+ const char *str;
+
+ config_init(&cfg);
+
+ /* Read the file. If there is an error, report it and exit. */
+ if(! config_read_file(&cfg, "example.cfg"))
+ {
+ fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
+ config_error_line(&cfg), config_error_text(&cfg));
+ config_destroy(&cfg);
+ return(EXIT_FAILURE);
+ }
+
+ /* Get the store name. */
+ if(config_lookup_string(&cfg, "name", &str))
+ printf("Store name: %s\n\n", str);
+ else
+ fprintf(stderr, "No 'name' setting in configuration file.\n");
+
+ /* Output a list of all books in the inventory. */
+ setting = config_lookup(&cfg, "inventory.books");
+ if(setting != NULL)
+ {
+ int count = config_setting_length(setting);
+ int i;
+
+ printf("%-30s %-30s %-6s %s\n", "TITLE", "AUTHOR", "PRICE", "QTY");
+
+ for(i = 0; i < count; ++i)
+ {
+ config_setting_t *book = config_setting_get_elem(setting, i);
+
+ /* Only output the record if all of the expected fields are present. */
+ const char *title, *author;
+ double price;
+ int qty;
+
+ if(!(config_setting_lookup_string(book, "title", &title)
+ && config_setting_lookup_string(book, "author", &author)
+ && config_setting_lookup_float(book, "price", &price)
+ && config_setting_lookup_int(book, "qty", &qty)))
+ continue;
+
+ printf("%-30s %-30s $%6.2f %3d\n", title, author, price, qty);
+ }
+ putchar('\n');
+ }
+
+ /* Output a list of all movies in the inventory. */
+ setting = config_lookup(&cfg, "inventory.movies");
+ if(setting != NULL)
+ {
+ unsigned int count = config_setting_length(setting);
+ unsigned int i;
+
+ printf("%-30s %-10s %-6s %s\n", "TITLE", "MEDIA", "PRICE", "QTY");
+ for(i = 0; i < count; ++i)
+ {
+ config_setting_t *movie = config_setting_get_elem(setting, i);
+
+ /* Only output the record if all of the expected fields are present. */
+ const char *title, *media;
+ double price;
+ int qty;
+
+ if(!(config_setting_lookup_string(movie, "title", &title)
+ && config_setting_lookup_string(movie, "media", &media)
+ && config_setting_lookup_float(movie, "price", &price)
+ && config_setting_lookup_int(movie, "qty", &qty)))
+ continue;
+
+ printf("%-30s %-10s $%6.2f %3d\n", title, media, price, qty);
+ }
+ putchar('\n');
+ }
+
+ config_destroy(&cfg);
+ return(EXIT_SUCCESS);
+}
+
+/* eof */
diff --git a/examples/c/example1.vcproj b/examples/c/example1.vcproj
new file mode 100644
index 0000000..b515e3b
--- /dev/null
+++ b/examples/c/example1.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c_example1"
+ ProjectGUID="{454984C5-C302-4CE2-9B17-15B96E05E120}"
+ RootNamespace="c_example1"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example1.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\example.cfg"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c/example1.vcxproj b/examples/c/example1.vcxproj
new file mode 100644
index 0000000..df6b234
--- /dev/null
+++ b/examples/c/example1.vcxproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c_example1</ProjectName>
+ <ProjectGuid>{454984C5-C302-4CE2-9B17-15B96E05E120}</ProjectGuid>
+ <RootNamespace>c_example1</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>$(ProjectName)d</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example1.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig.vcxproj">
+ <Project>{1a234565-926d-49b2-83e4-d56e0c38c9f2}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c/example1.vcxproj.filters b/examples/c/example1.vcxproj.filters
new file mode 100644
index 0000000..d61799b
--- /dev/null
+++ b/examples/c/example1.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{695c9968-a03a-429a-a0bb-3a17c4984751}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{fe9d78f1-4a8d-4a96-8a2c-d580ef568e0a}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{d4a21295-5ebf-4c21-abb8-ec6726caf83f}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c/example2.c b/examples/c/example2.c
new file mode 100644
index 0000000..2859bd9
--- /dev/null
+++ b/examples/c/example2.c
@@ -0,0 +1,97 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <libconfig.h>
+
+/* This example reads the configuration file 'example.cfg', adds a new
+ * movie record to the movies list, and writes the updated configuration to
+ * 'updated.cfg'.
+ */
+
+int main(int argc, char **argv)
+{
+ static const char *output_file = "updated.cfg";
+ config_t cfg;
+ config_setting_t *root, *setting, *movie;
+
+ config_init(&cfg);
+ config_set_options(&cfg,
+ (CONFIG_OPTION_FSYNC
+ | CONFIG_OPTION_SEMICOLON_SEPARATORS
+ | CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS
+ | CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE));
+
+ /* Read the file. If there is an error, report it and exit. */
+ if(! config_read_file(&cfg, "example.cfg"))
+ {
+ fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
+ config_error_line(&cfg), config_error_text(&cfg));
+ config_destroy(&cfg);
+ return(EXIT_FAILURE);
+ }
+
+ /* Find the 'movies' setting. Add intermediate settings if they don't yet
+ * exist.
+ */
+ root = config_root_setting(&cfg);
+
+ setting = config_setting_get_member(root, "inventory");
+ if(!setting)
+ setting = config_setting_add(root, "inventory", CONFIG_TYPE_GROUP);
+
+ setting = config_setting_get_member(setting, "movies");
+ if(!setting)
+ setting = config_setting_add(setting, "movies", CONFIG_TYPE_LIST);
+
+ /* Create the new movie entry. */
+ movie = config_setting_add(setting, NULL, CONFIG_TYPE_GROUP);
+
+ setting = config_setting_add(movie, "title", CONFIG_TYPE_STRING);
+ config_setting_set_string(setting, "Buckaroo Banzai");
+
+ setting = config_setting_add(movie, "media", CONFIG_TYPE_STRING);
+ config_setting_set_string(setting, "DVD");
+
+ setting = config_setting_add(movie, "price", CONFIG_TYPE_FLOAT);
+ config_setting_set_float(setting, 12.99);
+
+ setting = config_setting_add(movie, "qty", CONFIG_TYPE_INT);
+ config_setting_set_float(setting, 20);
+
+ /* Write out the updated configuration. */
+ if(! config_write_file(&cfg, output_file))
+ {
+ fprintf(stderr, "Error while writing file.\n");
+ config_destroy(&cfg);
+ return(EXIT_FAILURE);
+ }
+
+ fprintf(stderr, "Updated configuration successfully written to: %s\n",
+ output_file);
+
+ config_destroy(&cfg);
+ return(EXIT_SUCCESS);
+}
+
+/* eof */
diff --git a/examples/c/example2.vcproj b/examples/c/example2.vcproj
new file mode 100644
index 0000000..0985ae5
--- /dev/null
+++ b/examples/c/example2.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c_example2"
+ ProjectGUID="{E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}"
+ RootNamespace="c_example2"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example2.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\example.cfg"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c/example2.vcxproj b/examples/c/example2.vcxproj
new file mode 100644
index 0000000..bf199af
--- /dev/null
+++ b/examples/c/example2.vcxproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c_example2</ProjectName>
+ <ProjectGuid>{E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}</ProjectGuid>
+ <RootNamespace>c_example2</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy $(SolutionDir)\examples\c\example.cfg $(TargetDir) /d</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example2.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig.vcxproj">
+ <Project>{1a234565-926d-49b2-83e4-d56e0c38c9f2}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c/example2.vcxproj.filters b/examples/c/example2.vcxproj.filters
new file mode 100644
index 0000000..d491c94
--- /dev/null
+++ b/examples/c/example2.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{0a67dcc6-ccb4-4209-aeb4-b0c3f7fbc137}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{16953a56-fdff-4e83-81f1-f668e07d4a28}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{98b16d54-1834-439c-a5d8-c203c251db00}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c/example3.c b/examples/c/example3.c
new file mode 100644
index 0000000..5b7f8a7
--- /dev/null
+++ b/examples/c/example3.c
@@ -0,0 +1,79 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <libconfig.h>
+
+/* This example constructs a new configuration in memory and writes it to
+ * 'newconfig.cfg'.
+ */
+
+int main(int argc, char **argv)
+{
+ static const char *output_file = "newconfig.cfg";
+ config_t cfg;
+ config_setting_t *root, *setting, *group, *array;
+ int i;
+
+ config_init(&cfg);
+ root = config_root_setting(&cfg);
+
+ /* Add some settings to the configuration. */
+ group = config_setting_add(root, "address", CONFIG_TYPE_GROUP);
+
+ setting = config_setting_add(group, "street", CONFIG_TYPE_STRING);
+ config_setting_set_string(setting, "1 Woz Way");
+
+ setting = config_setting_add(group, "city", CONFIG_TYPE_STRING);
+ config_setting_set_string(setting, "San Jose");
+
+ setting = config_setting_add(group, "state", CONFIG_TYPE_STRING);
+ config_setting_set_string(setting, "CA");
+
+ setting = config_setting_add(group, "zip", CONFIG_TYPE_INT);
+ config_setting_set_int(setting, 95110);
+
+ array = config_setting_add(root, "numbers", CONFIG_TYPE_ARRAY);
+
+ for(i = 0; i < 10; ++i)
+ {
+ setting = config_setting_add(array, NULL, CONFIG_TYPE_INT);
+ config_setting_set_int(setting, 10 * i);
+ }
+
+ /* Write out the new configuration. */
+ if(! config_write_file(&cfg, output_file))
+ {
+ fprintf(stderr, "Error while writing file.\n");
+ config_destroy(&cfg);
+ return(EXIT_FAILURE);
+ }
+
+ fprintf(stderr, "New configuration successfully written to: %s\n",
+ output_file);
+
+ config_destroy(&cfg);
+ return(EXIT_SUCCESS);
+}
+
+/* eof */
diff --git a/examples/c/example3.vcproj b/examples/c/example3.vcproj
new file mode 100644
index 0000000..132b089
--- /dev/null
+++ b/examples/c/example3.vcproj
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="c_example3"
+ ProjectGUID="{93568409-C7AD-4A32-88E2-8883E10A8F7E}"
+ RootNamespace="c_example3"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../lib"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../lib"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\example3.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\example.cfg"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/examples/c/example3.vcxproj b/examples/c/example3.vcxproj
new file mode 100644
index 0000000..1b1c92a
--- /dev/null
+++ b/examples/c/example3.vcxproj
@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>c_example3</ProjectName>
+ <ProjectGuid>{93568409-C7AD-4A32-88E2-8883E10A8F7E}</ProjectGuid>
+ <RootNamespace>c_example3</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="example3.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\lib\libconfig.vcxproj">
+ <Project>{1a234565-926d-49b2-83e4-d56e0c38c9f2}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c/example3.vcxproj.filters b/examples/c/example3.vcxproj.filters
new file mode 100644
index 0000000..b6baac1
--- /dev/null
+++ b/examples/c/example3.vcxproj.filters
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{0f232ad0-1ff8-42b5-8569-2cf613307e68}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{44cdb8d9-6189-45ba-8332-1efdc97ba004}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{2593a235-db4c-4de1-9066-140aacf1bce8}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="example3.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="example.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/examples/c/example4.c b/examples/c/example4.c
new file mode 100644
index 0000000..05396c5
--- /dev/null
+++ b/examples/c/example4.c
@@ -0,0 +1,137 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <dirent.h>
+#include <fnmatch.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <libconfig.h>
+
+/* This example reads the configuration file 'example.cfg' and displays
+ * some of its contents.
+ */
+
+static const char **include_func(config_t *config,
+ const char *include_dir,
+ const char *path,
+ const char **error)
+{
+ char *p;
+ DIR *dp;
+ struct dirent *dir_entry;
+ struct stat stat_buf;
+ char include_path[PATH_MAX + 1];
+ size_t include_path_len = 0;
+ char file_path[PATH_MAX + 1];
+ char **result = NULL;
+ char **result_next = result;
+ int result_count = 0;
+ int result_capacity = 0;
+
+ *include_path = 0;
+
+ if(*path != '/')
+ {
+ if(include_dir)
+ {
+ strcat(include_path, include_dir);
+ include_path_len += strlen(include_dir);
+ }
+ }
+
+ p = strrchr(path, '/');
+ if(p > path)
+ {
+ int len = p - path;
+
+ if((include_path_len > 0)
+ && (*(include_path + include_path_len - 1) != '/'))
+ {
+ strcat(include_path, "/");
+ ++include_path_len;
+ }
+
+ strncat(include_path, path, len);
+ include_path_len += len;
+ }
+
+ if(include_path_len == 0)
+ {
+ strcpy(include_path, ".");
+ include_path_len = 1;
+ }
+
+ dp = opendir(include_path);
+ if(dp)
+ {
+ while((dir_entry = readdir(dp)) != NULL)
+ {
+ snprintf(file_path, PATH_MAX, "%s/%s", include_path, dir_entry->d_name);
+ if(lstat(file_path, &stat_buf) != 0) continue;
+ if(!S_ISREG(stat_buf.st_mode)) continue;
+ if(fnmatch(path, file_path, FNM_PATHNAME) != 0) continue;
+
+ if(result_count == result_capacity)
+ {
+ result_capacity += 16;
+ result = (char **)realloc(result, (result_capacity + 1) * sizeof(char *));
+ result_next = result + result_count;
+ }
+
+ *result_next = strdup(file_path);
+ ++result_next;
+ ++result_count;
+
+ printf("file: %s\n", file_path);
+ }
+ closedir(dp);
+ }
+
+ *result_next = NULL;
+
+ return((const char **)result);
+}
+
+int main(int argc, char **argv)
+{
+ config_t cfg;
+
+ config_init(&cfg);
+ config_set_include_func(&cfg, include_func);
+
+ /* Read the file. If there is an error, report it and exit. */
+ if(! config_read_file(&cfg, "example4.cfg"))
+ {
+ fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
+ config_error_line(&cfg), config_error_text(&cfg));
+ config_destroy(&cfg);
+ return(EXIT_FAILURE);
+ }
+
+ config_write(&cfg, stdout);
+
+ return(EXIT_SUCCESS);
+}
diff --git a/examples/c/example4.cfg b/examples/c/example4.cfg
new file mode 100644
index 0000000..7b5b75a
--- /dev/null
+++ b/examples/c/example4.cfg
@@ -0,0 +1,9 @@
+// Config file with wildcard includes
+
+
+books: (
+
+@include "cfg_includes/book*.cfg"
+
+
+);
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644
index 0000000..3a64deb
--- /dev/null
+++ b/lib/CMakeLists.txt
@@ -0,0 +1,140 @@
+set(libinc
+ libconfig.h)
+
+set(libsrc
+ grammar.h
+ parsectx.h
+ scanctx.h
+ scanner.h
+ win32/stdint.h
+ strbuf.h
+ strvec.h
+ util.h
+ wincompat.h
+ grammar.c
+ libconfig.c
+ scanctx.c
+ scanner.c
+ strbuf.c
+ strvec.c
+ util.c
+ wincompat.c)
+
+set(libinc_cpp
+ libconfig.h++
+ libconfig.hh)
+
+set(libsrc_cpp
+ ${libsrc}
+ libconfigcpp.cc)
+
+if(MSVC)
+ set(libname "libconfig")
+else()
+ set(libname "config")
+endif()
+
+add_library(${libname} ${libsrc} ${libinc})
+add_library(${libname}++ ${libsrc_cpp} ${libinc_cpp})
+
+set_target_properties(${libname}
+ PROPERTIES LINKER_LANGUAGE C
+ SOVERSION "${libconfig_VERSION_MAJOR}"
+ VERSION "${libconfig_VERSION}"
+ DEFINE_SYMBOL LIBCONFIG_EXPORTS
+ PUBLIC_HEADER "${libinc}")
+set_target_properties(${libname}++
+ PROPERTIES LINKER_LANGUAGE CXX
+ SOVERSION "${libconfig_VERSION_MAJOR}"
+ DEFINE_SYMBOL LIBCONFIGXX_EXPORTS
+ VERSION "${libconfig_VERSION}"
+ PUBLIC_HEADER "${libinc_cpp}")
+
+#check_symbol_exists(uselocale "locale.h" HAVE_USELOCALE)
+#check_symbol_exists(newlocale "locale.h" HAVE_NEWLOCALE)
+#check_symbol_exists(freelocale "locale.h" HAVE_FREELOCALE)
+
+if(BUILD_SHARED_LIBS)
+ target_compile_definitions(${libname}++ PRIVATE LIBCONFIG_STATIC)
+else()
+ target_compile_definitions(${libname} PUBLIC LIBCONFIG_STATIC)
+ target_compile_definitions(${libname}++ PUBLIC LIBCONFIGXX_STATIC)
+endif()
+
+if(HAVE_USELOCALE)
+target_compile_definitions(${libname}
+ PRIVATE "HAVE_USELOCALE")
+endif()
+
+if(HAVE_NEWLOCALE)
+target_compile_definitions(${libname}
+ PRIVATE "HAVE_NEWLOCALE")
+endif()
+
+if(HAVE_FREELOCALE)
+target_compile_definitions(${libname}
+ PRIVATE "HAVE_FREELOCALE")
+endif()
+
+if(MSVC)
+ target_compile_definitions(${libname}
+ PRIVATE
+ _CRT_SECURE_NO_DEPRECATE
+ YY_NO_UNISTD_H
+ YY_USE_CONST )
+
+ target_compile_definitions(${libname}++
+ PRIVATE
+ _CRT_SECURE_NO_DEPRECATE
+ YY_NO_UNISTD_H
+ YY_USE_CONST )
+endif()
+
+if(WIN32)
+ target_link_libraries(${libname} shlwapi)
+ target_link_libraries(${libname}++ shlwapi)
+endif()
+
+target_include_directories(${libname}
+ PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ )
+
+target_include_directories(${libname}++
+ PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ )
+
+install(TARGETS ${libname}
+ EXPORT libconfigTargets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+
+install(TARGETS ${libname}++
+ EXPORT libconfig++Targets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+
+
+include(CMakePackageConfigHelpers)
+foreach(target_name libconfig libconfig++)
+ write_basic_package_version_file("${target_name}ConfigVersion.cmake"
+ VERSION ${PACKAGE_VERSION}
+ COMPATIBILITY SameMajorVersion
+ )
+
+ install(EXPORT ${target_name}Targets
+ FILE "${target_name}Config.cmake"
+ NAMESPACE libconfig::
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libconfig
+ )
+
+ install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/${target_name}ConfigVersion.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libconfig"
+ )
+endforeach()
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..ce4c599
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,97 @@
+
+# Versioning rules ( C:R:A )
+#
+# Perform EACH step that applies.
+#
+# 1. Start with version 0:0:0.
+# 2. If any of the sources have changed, increment R. This is a new revision
+# of the current interface.
+# 3. If the interface has changed, increment C and set R to 0. This is the
+# first revision of a new interface.
+# 4. If the interface has changed, and the new interface is a superset of the
+# previous interface (that is, if the previous interface has not been
+# broken by the changes in this new release), increment A. This release is
+# backwards compatible with the previous release.
+# 5. If the new interface has removed elements with respect to the
+# previous interface, then backward compatibility is broken; set A to 0.
+# This release has a new, but backwards incompatible interface.
+#
+# For more info see section 6.3 of the GNU Libtool Manual.
+
+VERINFO = -version-info 12:0:1
+
+## Flex
+PARSER_PREFIX = libconfig_yy
+AM_LFLAGS = --header-file=scanner.h --prefix=$(PARSER_PREFIX)
+
+## Bison
+AM_YFLAGS = -d -p $(PARSER_PREFIX)
+
+
+libsrc = grammar.y libconfig.c parsectx.h scanctx.c scanctx.h scanner.l \
+ strbuf.c strbuf.h strvec.c strvec.h util.c util.h wincompat.c wincompat.h
+libinc = libconfig.h
+
+libsrc_cpp = $(libsrc) libconfigcpp.c++
+libinc_cpp = libconfig.h++
+
+BUILT_SOURCES = scanner.c scanner.h grammar.c grammar.h
+
+
+## Build mode: C-only or C & C++
+lib_LTLIBRARIES = libconfig.la
+
+if BUILDCXX
+lib_LTLIBRARIES += libconfig++.la
+endif
+
+
+libconfig_la_SOURCES = $(libsrc)
+
+libconfig___la_SOURCES = $(libsrc_cpp)
+
+
+libcppflags = -D_REENTRANT
+libcppxxflags = -D_REENTRANT
+
+if GNU_WIN
+libcppflags += -DLIBCONFIG_EXPORTS
+libcppxxflags += -DLIBCONFIGXX_EXPORTS -DLIBCONFIG_STATIC
+endif
+
+libconfig_la_CPPFLAGS = -DPARSER_PREFIX=\"$(PARSER_PREFIX)\" $(libcppflags)
+libconfig___la_CPPFLAGS = -DPARSER_PREFIX=\"$(PARSER_PREFIX)\" $(libcppxxflags)
+
+include_HEADERS = $(libinc)
+
+if BUILDCXX
+ include_HEADERS += $(libinc_cpp)
+endif
+
+
+libconfig_la_LDFLAGS = $(VERINFO) -no-undefined
+
+libconfig___la_LDFLAGS = $(VERINFO) -no-undefined
+
+
+EXTRA_DIST = \
+ $(BUILT_SOURCES) \
+ libconfigcpp.cc libconfig.hh \
+ *.vcproj \
+ *.vcxproj
+
+pkgconfigdir = $(libdir)/pkgconfig
+
+pkgconfig_DATA = libconfig.pc
+
+if BUILDCXX
+pkgconfig_DATA += libconfig++.pc
+endif
+
+cmakedir = $(libdir)/cmake/libconfig
+cmake_DATA = libconfigConfig.cmake
+
+if BUILDCXX
+cmakeppdir = $(libdir)/cmake/libconfig++
+cmakepp_DATA = libconfig++Config.cmake
+endif
diff --git a/lib/grammar.c b/lib/grammar.c
new file mode 100644
index 0000000..a4a37ec
--- /dev/null
+++ b/lib/grammar.c
@@ -0,0 +1,1867 @@
+/* A Bison parser, made by GNU Bison 3.0.4. */
+
+/* Bison implementation for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Bison version. */
+#define YYBISON_VERSION "3.0.4"
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 1
+
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
+
+/* Substitute the variable and function names. */
+#define yyparse libconfig_yyparse
+#define yylex libconfig_yylex
+#define yyerror libconfig_yyerror
+#define yydebug libconfig_yydebug
+#define yynerrs libconfig_yynerrs
+
+
+/* Copy the first part of user declarations. */
+#line 32 "grammar.y" /* yacc.c:339 */
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "libconfig.h"
+#include "parsectx.h"
+#include "scanctx.h"
+#include "util.h"
+#include "wincompat.h"
+
+/* These declarations are provided to suppress compiler warnings. */
+extern int libconfig_yylex();
+extern int libconfig_yyget_lineno();
+
+static const char *err_array_elem_type = "mismatched element type in array";
+static const char *err_duplicate_setting = "duplicate setting name";
+
+#define IN_ARRAY() \
+ (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY))
+
+#define IN_LIST() \
+ (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST))
+
+static void capture_parse_pos(void *scanner, struct scan_context *scan_ctx,
+ config_setting_t *setting)
+{
+ setting->line = (unsigned int)libconfig_yyget_lineno(scanner);
+ setting->file = libconfig_scanctx_current_filename(scan_ctx);
+}
+
+#define CAPTURE_PARSE_POS(S) \
+ capture_parse_pos(scanner, scan_ctx, (S))
+
+void libconfig_yyerror(void *scanner, struct parse_context *ctx,
+ struct scan_context *scan_ctx, char const *s)
+{
+ if(ctx->config->error_text) return;
+ ctx->config->error_line = libconfig_yyget_lineno(scanner);
+ ctx->config->error_text = s;
+}
+
+
+#line 115 "grammar.c" /* yacc.c:339 */
+
+# ifndef YY_NULLPTR
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* In a future release of Bison, this section will be replaced
+ by #include "y.tab.h". */
+#ifndef YY_LIBCONFIG_YY_GRAMMAR_H_INCLUDED
+# define YY_LIBCONFIG_YY_GRAMMAR_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int libconfig_yydebug;
+#endif
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ enum yytokentype
+ {
+ TOK_BOOLEAN = 258,
+ TOK_INTEGER = 259,
+ TOK_HEX = 260,
+ TOK_INTEGER64 = 261,
+ TOK_HEX64 = 262,
+ TOK_FLOAT = 263,
+ TOK_STRING = 264,
+ TOK_NAME = 265,
+ TOK_EQUALS = 266,
+ TOK_NEWLINE = 267,
+ TOK_ARRAY_START = 268,
+ TOK_ARRAY_END = 269,
+ TOK_LIST_START = 270,
+ TOK_LIST_END = 271,
+ TOK_COMMA = 272,
+ TOK_GROUP_START = 273,
+ TOK_GROUP_END = 274,
+ TOK_SEMICOLON = 275,
+ TOK_GARBAGE = 276,
+ TOK_ERROR = 277
+ };
+#endif
+/* Tokens. */
+#define TOK_BOOLEAN 258
+#define TOK_INTEGER 259
+#define TOK_HEX 260
+#define TOK_INTEGER64 261
+#define TOK_HEX64 262
+#define TOK_FLOAT 263
+#define TOK_STRING 264
+#define TOK_NAME 265
+#define TOK_EQUALS 266
+#define TOK_NEWLINE 267
+#define TOK_ARRAY_START 268
+#define TOK_ARRAY_END 269
+#define TOK_LIST_START 270
+#define TOK_LIST_END 271
+#define TOK_COMMA 272
+#define TOK_GROUP_START 273
+#define TOK_GROUP_END 274
+#define TOK_SEMICOLON 275
+#define TOK_GARBAGE 276
+#define TOK_ERROR 277
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+
+union YYSTYPE
+{
+#line 76 "grammar.y" /* yacc.c:355 */
+
+ int ival;
+ long long llval;
+ double fval;
+ char *sval;
+
+#line 206 "grammar.c" /* yacc.c:355 */
+};
+
+typedef union YYSTYPE YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+int libconfig_yyparse (void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx);
+
+#endif /* !YY_LIBCONFIG_YY_GRAMMAR_H_INCLUDED */
+
+/* Copy the second part of user declarations. */
+
+#line 222 "grammar.c" /* yacc.c:358 */
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#else
+typedef signed char yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+# define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(E) ((void) (E))
+#else
+# define YYUSE(E) /* empty */
+#endif
+
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+# endif
+# else
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined EXIT_SUCCESS
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined EXIT_SUCCESS
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 6
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 35
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 23
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 20
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 41
+/* YYNSTATES -- Number of states. */
+#define YYNSTATES 47
+
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 277
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
+static const yytype_uint8 yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22
+};
+
+#if YYDEBUG
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+static const yytype_uint16 yyrline[] =
+{
+ 0, 92, 92, 94, 98, 99, 102, 104, 107, 109,
+ 110, 115, 114, 134, 133, 157, 156, 179, 180, 181,
+ 182, 186, 187, 191, 211, 233, 255, 277, 299, 317,
+ 345, 346, 347, 350, 352, 356, 357, 358, 361, 363,
+ 368, 367
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || 0
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "TOK_BOOLEAN", "TOK_INTEGER", "TOK_HEX",
+ "TOK_INTEGER64", "TOK_HEX64", "TOK_FLOAT", "TOK_STRING", "TOK_NAME",
+ "TOK_EQUALS", "TOK_NEWLINE", "TOK_ARRAY_START", "TOK_ARRAY_END",
+ "TOK_LIST_START", "TOK_LIST_END", "TOK_COMMA", "TOK_GROUP_START",
+ "TOK_GROUP_END", "TOK_SEMICOLON", "TOK_GARBAGE", "TOK_ERROR", "$accept",
+ "configuration", "setting_list", "setting_list_optional",
+ "setting_terminator", "setting", "$@1", "array", "$@2", "list", "$@3",
+ "value", "string", "simple_value", "value_list", "value_list_optional",
+ "simple_value_list", "simple_value_list_optional", "group", "$@4", YY_NULLPTR
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
+static const yytype_uint16 yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277
+};
+# endif
+
+#define YYPACT_NINF -26
+
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-26)))
+
+#define YYTABLE_NINF -1
+
+#define yytable_value_is_error(Yytable_value) \
+ 0
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int8 yypact[] =
+{
+ -8, -26, 12, -8, -26, 5, -26, -26, 0, -26,
+ -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
+ -26, -6, 10, -26, -26, 23, 0, -8, -26, -26,
+ -26, -26, -26, 3, 7, -26, 6, 8, -8, 14,
+ 23, -26, 0, -26, -26, -26, -26
+};
+
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
+static const yytype_uint8 yydefact[] =
+{
+ 2, 11, 0, 3, 4, 0, 1, 5, 0, 23,
+ 24, 26, 25, 27, 28, 21, 13, 15, 40, 18,
+ 19, 8, 29, 17, 20, 38, 33, 6, 10, 9,
+ 12, 22, 35, 39, 0, 30, 34, 0, 7, 0,
+ 37, 14, 32, 16, 41, 36, 31
+};
+
+ /* YYPGOTO[NTERM-NUM]. */
+static const yytype_int8 yypgoto[] =
+{
+ -26, -26, -5, -26, -26, -3, -26, -26, -26, -26,
+ -26, -25, -26, -15, -26, -26, -26, -26, -26, -26
+};
+
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
+{
+ -1, 2, 3, 39, 30, 4, 5, 19, 25, 20,
+ 26, 21, 22, 23, 36, 37, 33, 34, 24, 27
+};
+
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
+static const yytype_uint8 yytable[] =
+{
+ 7, 35, 1, 9, 10, 11, 12, 13, 14, 15,
+ 32, 28, 6, 16, 29, 17, 8, 46, 18, 31,
+ 40, 41, 38, 42, 43, 45, 9, 10, 11, 12,
+ 13, 14, 15, 44, 0, 7
+};
+
+static const yytype_int8 yycheck[] =
+{
+ 3, 26, 10, 3, 4, 5, 6, 7, 8, 9,
+ 25, 17, 0, 13, 20, 15, 11, 42, 18, 9,
+ 17, 14, 27, 17, 16, 40, 3, 4, 5, 6,
+ 7, 8, 9, 19, -1, 38
+};
+
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const yytype_uint8 yystos[] =
+{
+ 0, 10, 24, 25, 28, 29, 0, 28, 11, 3,
+ 4, 5, 6, 7, 8, 9, 13, 15, 18, 30,
+ 32, 34, 35, 36, 41, 31, 33, 42, 17, 20,
+ 27, 9, 36, 39, 40, 34, 37, 38, 25, 26,
+ 17, 14, 17, 16, 19, 36, 34
+};
+
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+ 27, 29, 28, 31, 30, 33, 32, 34, 34, 34,
+ 34, 35, 35, 36, 36, 36, 36, 36, 36, 36,
+ 37, 37, 37, 38, 38, 39, 39, 39, 40, 40,
+ 42, 41
+};
+
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 0, 1, 1, 2, 0, 1, 0, 1,
+ 1, 0, 5, 0, 4, 0, 4, 1, 1, 1,
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 2, 0, 1, 1, 3, 2, 0, 1,
+ 0, 4
+};
+
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (scanner, ctx, scan_ctx, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+while (0)
+
+/* Error token number */
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value, scanner, ctx, scan_ctx); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
+{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
+ YYUSE (scanner);
+ YYUSE (ctx);
+ YYUSE (scan_ctx);
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ YYUSE (yytype);
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
+{
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, ctx, scan_ctx);
+ YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+static void
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
+{
+ unsigned long int yylno = yyrline[yyrule];
+ int yynrhs = yyr2[yyrule];
+ int yyi;
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ , scanner, ctx, scan_ctx);
+ YYFPRINTF (stderr, "\n");
+ }
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule, scanner, ctx, scan_ctx); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+yystrlen (const char *yystr)
+{
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
+ continue;
+ return yylen;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+ char *yyd = yydest;
+ const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ if (! yyres)
+ return yystrlen (yystr);
+
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
+{
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
+ {
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
+
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
+
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
+ }
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
+}
+#endif /* YYERROR_VERBOSE */
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
+{
+ YYUSE (yyvaluep);
+ YYUSE (scanner);
+ YYUSE (ctx);
+ YYUSE (scan_ctx);
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ switch (yytype)
+ {
+ case 9: /* TOK_STRING */
+#line 88 "grammar.y" /* yacc.c:1257 */
+ { free(((*yyvaluep).sval)); }
+#line 1083 "grammar.c" /* yacc.c:1257 */
+ break;
+
+
+ default:
+ break;
+ }
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
+
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+int
+yyparse (void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
+{
+/* The lookahead symbol. */
+int yychar;
+
+
+/* The semantic value of the lookahead symbol. */
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+ /* Number of syntax errors so far. */
+ int yynerrs;
+
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+
+ /* The stacks and their tools:
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
+
+ Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+
+ YYSIZE_T yystacksize;
+
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
+
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. So pushing a state here evens the stacks. */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyexhaustedlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+ /* Do appropriate processing given the current state. Read a
+ lookahead token if we need one and don't already have one. */
+
+ /* First try to decide what to do without reference to lookahead token. */
+ yyn = yypact[yystate];
+ if (yypact_value_is_default (yyn))
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = yylex (&yylval, scanner);
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
+
+ yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ '$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 11:
+#line 115 "grammar.y" /* yacc.c:1646 */
+ {
+ ctx->setting = config_setting_add(ctx->parent, (yyvsp[0].sval), CONFIG_TYPE_NONE);
+
+ if(ctx->setting == NULL)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_duplicate_setting);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(ctx->setting);
+ }
+ }
+#line 1363 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 13:
+#line 134 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_LIST())
+ {
+ ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_ARRAY);
+ CAPTURE_PARSE_POS(ctx->parent);
+ }
+ else
+ {
+ ctx->setting->type = CONFIG_TYPE_ARRAY;
+ ctx->parent = ctx->setting;
+ ctx->setting = NULL;
+ }
+ }
+#line 1381 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 14:
+#line 149 "grammar.y" /* yacc.c:1646 */
+ {
+ if(ctx->parent)
+ ctx->parent = ctx->parent->parent;
+ }
+#line 1390 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 15:
+#line 157 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_LIST())
+ {
+ ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_LIST);
+ CAPTURE_PARSE_POS(ctx->parent);
+ }
+ else
+ {
+ ctx->setting->type = CONFIG_TYPE_LIST;
+ ctx->parent = ctx->setting;
+ ctx->setting = NULL;
+ }
+ }
+#line 1408 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 16:
+#line 172 "grammar.y" /* yacc.c:1646 */
+ {
+ if(ctx->parent)
+ ctx->parent = ctx->parent->parent;
+ }
+#line 1417 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 21:
+#line 186 "grammar.y" /* yacc.c:1646 */
+ { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); }
+#line 1423 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 22:
+#line 187 "grammar.y" /* yacc.c:1646 */
+ { libconfig_parsectx_append_string(ctx, (yyvsp[0].sval)); free((yyvsp[0].sval)); }
+#line 1429 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 23:
+#line 192 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_bool_elem(ctx->parent, -1,
+ (int)(yyvsp[0].ival));
+
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ config_setting_set_bool(ctx->setting, (int)(yyvsp[0].ival));
+ }
+#line 1453 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 24:
+#line 212 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival));
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_DEFAULT);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int(ctx->setting, (yyvsp[0].ival));
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT);
+ }
+ }
+#line 1479 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 25:
+#line 234 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval));
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_DEFAULT);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int64(ctx->setting, (yyvsp[0].llval));
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT);
+ }
+ }
+#line 1505 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 26:
+#line 256 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[0].ival));
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_HEX);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int(ctx->setting, (yyvsp[0].ival));
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX);
+ }
+ }
+#line 1531 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 27:
+#line 278 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[0].llval));
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_HEX);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int64(ctx->setting, (yyvsp[0].llval));
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX);
+ }
+ }
+#line 1557 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 28:
+#line 300 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_float_elem(ctx->parent, -1, (yyvsp[0].fval));
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ config_setting_set_float(ctx->setting, (yyvsp[0].fval));
+ }
+#line 1579 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 29:
+#line 318 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ const char *s = libconfig_parsectx_take_string(ctx);
+ config_setting_t *e = config_setting_set_string_elem(ctx->parent, -1, s);
+ __delete(s);
+
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ const char *s = libconfig_parsectx_take_string(ctx);
+ config_setting_set_string(ctx->setting, s);
+ __delete(s);
+ }
+ }
+#line 1608 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 40:
+#line 368 "grammar.y" /* yacc.c:1646 */
+ {
+ if(IN_LIST())
+ {
+ ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_GROUP);
+ CAPTURE_PARSE_POS(ctx->parent);
+ }
+ else
+ {
+ ctx->setting->type = CONFIG_TYPE_GROUP;
+ ctx->parent = ctx->setting;
+ ctx->setting = NULL;
+ }
+ }
+#line 1626 "grammar.c" /* yacc.c:1646 */
+ break;
+
+ case 41:
+#line 383 "grammar.y" /* yacc.c:1646 */
+ {
+ if(ctx->parent)
+ ctx->parent = ctx->parent->parent;
+ }
+#line 1635 "grammar.c" /* yacc.c:1646 */
+ break;
+
+
+#line 1639 "grammar.c" /* yacc.c:1646 */
+ default: break;
+ }
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+ /* Now 'shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
+yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if ! YYERROR_VERBOSE
+ yyerror (scanner, ctx, scan_ctx, YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
+ {
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (scanner, ctx, scan_ctx, yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
+ }
+# undef YYSYNTAX_ERROR
+#endif
+ }
+
+
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval, scanner, ctx, scan_ctx);
+ yychar = YYEMPTY;
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
+ goto yyerrorlab;
+
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (!yypact_value_is_default (yyn))
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp, scanner, ctx, scan_ctx);
+ YYPOPSTACK (1);
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#if !defined yyoverflow || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (scanner, ctx, scan_ctx, YY_("memory exhausted"));
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+ if (yychar != YYEMPTY)
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, scanner, ctx, scan_ctx);
+ }
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ yystos[*yyssp], yyvsp, scanner, ctx, scan_ctx);
+ YYPOPSTACK (1);
+ }
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ return yyresult;
+}
+#line 389 "grammar.y" /* yacc.c:1906 */
+
diff --git a/lib/grammar.h b/lib/grammar.h
new file mode 100644
index 0000000..9b746df
--- /dev/null
+++ b/lib/grammar.h
@@ -0,0 +1,116 @@
+/* A Bison parser, made by GNU Bison 3.0.4. */
+
+/* Bison interface for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+#ifndef YY_LIBCONFIG_YY_GRAMMAR_H_INCLUDED
+# define YY_LIBCONFIG_YY_GRAMMAR_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int libconfig_yydebug;
+#endif
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ enum yytokentype
+ {
+ TOK_BOOLEAN = 258,
+ TOK_INTEGER = 259,
+ TOK_HEX = 260,
+ TOK_INTEGER64 = 261,
+ TOK_HEX64 = 262,
+ TOK_FLOAT = 263,
+ TOK_STRING = 264,
+ TOK_NAME = 265,
+ TOK_EQUALS = 266,
+ TOK_NEWLINE = 267,
+ TOK_ARRAY_START = 268,
+ TOK_ARRAY_END = 269,
+ TOK_LIST_START = 270,
+ TOK_LIST_END = 271,
+ TOK_COMMA = 272,
+ TOK_GROUP_START = 273,
+ TOK_GROUP_END = 274,
+ TOK_SEMICOLON = 275,
+ TOK_GARBAGE = 276,
+ TOK_ERROR = 277
+ };
+#endif
+/* Tokens. */
+#define TOK_BOOLEAN 258
+#define TOK_INTEGER 259
+#define TOK_HEX 260
+#define TOK_INTEGER64 261
+#define TOK_HEX64 262
+#define TOK_FLOAT 263
+#define TOK_STRING 264
+#define TOK_NAME 265
+#define TOK_EQUALS 266
+#define TOK_NEWLINE 267
+#define TOK_ARRAY_START 268
+#define TOK_ARRAY_END 269
+#define TOK_LIST_START 270
+#define TOK_LIST_END 271
+#define TOK_COMMA 272
+#define TOK_GROUP_START 273
+#define TOK_GROUP_END 274
+#define TOK_SEMICOLON 275
+#define TOK_GARBAGE 276
+#define TOK_ERROR 277
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+
+union YYSTYPE
+{
+#line 76 "grammar.y" /* yacc.c:1909 */
+
+ int ival;
+ long long llval;
+ double fval;
+ char *sval;
+
+#line 105 "grammar.h" /* yacc.c:1909 */
+};
+
+typedef union YYSTYPE YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+int libconfig_yyparse (void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx);
+
+#endif /* !YY_LIBCONFIG_YY_GRAMMAR_H_INCLUDED */
diff --git a/lib/grammar.y b/lib/grammar.y
new file mode 100644
index 0000000..87dac00
--- /dev/null
+++ b/lib/grammar.y
@@ -0,0 +1,389 @@
+/* -*- mode: C -*- */
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+%defines
+%output "y.tab.c"
+%pure-parser
+%lex-param{void *scanner}
+%parse-param{void *scanner}
+%parse-param{struct parse_context *ctx}
+%parse-param{struct scan_context *scan_ctx}
+
+%{
+#include <string.h>
+#include <stdlib.h>
+
+#include "libconfig.h"
+#include "parsectx.h"
+#include "scanctx.h"
+#include "util.h"
+#include "wincompat.h"
+
+/* These declarations are provided to suppress compiler warnings. */
+extern int libconfig_yylex();
+extern int libconfig_yyget_lineno();
+
+static const char *err_array_elem_type = "mismatched element type in array";
+static const char *err_duplicate_setting = "duplicate setting name";
+
+#define IN_ARRAY() \
+ (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY))
+
+#define IN_LIST() \
+ (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST))
+
+static void capture_parse_pos(void *scanner, struct scan_context *scan_ctx,
+ config_setting_t *setting)
+{
+ setting->line = (unsigned int)libconfig_yyget_lineno(scanner);
+ setting->file = libconfig_scanctx_current_filename(scan_ctx);
+}
+
+#define CAPTURE_PARSE_POS(S) \
+ capture_parse_pos(scanner, scan_ctx, (S))
+
+void libconfig_yyerror(void *scanner, struct parse_context *ctx,
+ struct scan_context *scan_ctx, char const *s)
+{
+ if(ctx->config->error_text) return;
+ ctx->config->error_line = libconfig_yyget_lineno(scanner);
+ ctx->config->error_text = s;
+}
+
+%}
+
+%union
+{
+ int ival;
+ long long llval;
+ double fval;
+ char *sval;
+}
+
+%token <ival> TOK_BOOLEAN TOK_INTEGER TOK_HEX
+%token <llval> TOK_INTEGER64 TOK_HEX64
+%token <fval> TOK_FLOAT
+%token <sval> TOK_STRING TOK_NAME
+%token TOK_EQUALS TOK_NEWLINE TOK_ARRAY_START TOK_ARRAY_END TOK_LIST_START TOK_LIST_END TOK_COMMA TOK_GROUP_START TOK_GROUP_END TOK_SEMICOLON TOK_GARBAGE TOK_ERROR
+%destructor { free($$); } TOK_STRING
+
+%%
+
+configuration:
+ /* empty */
+ | setting_list
+ ;
+
+setting_list:
+ setting
+ | setting_list setting
+ ;
+
+setting_list_optional:
+ /* empty */
+ | setting_list
+ ;
+
+setting_terminator:
+ /* empty */
+ | TOK_SEMICOLON
+ | TOK_COMMA
+ ;
+
+setting:
+ TOK_NAME
+ {
+ ctx->setting = config_setting_add(ctx->parent, $1, CONFIG_TYPE_NONE);
+
+ if(ctx->setting == NULL)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_duplicate_setting);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(ctx->setting);
+ }
+ }
+
+ TOK_EQUALS value setting_terminator
+ ;
+
+array:
+ TOK_ARRAY_START
+ {
+ if(IN_LIST())
+ {
+ ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_ARRAY);
+ CAPTURE_PARSE_POS(ctx->parent);
+ }
+ else
+ {
+ ctx->setting->type = CONFIG_TYPE_ARRAY;
+ ctx->parent = ctx->setting;
+ ctx->setting = NULL;
+ }
+ }
+ simple_value_list_optional
+ TOK_ARRAY_END
+ {
+ if(ctx->parent)
+ ctx->parent = ctx->parent->parent;
+ }
+ ;
+
+list:
+ TOK_LIST_START
+ {
+ if(IN_LIST())
+ {
+ ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_LIST);
+ CAPTURE_PARSE_POS(ctx->parent);
+ }
+ else
+ {
+ ctx->setting->type = CONFIG_TYPE_LIST;
+ ctx->parent = ctx->setting;
+ ctx->setting = NULL;
+ }
+ }
+ value_list_optional
+ TOK_LIST_END
+ {
+ if(ctx->parent)
+ ctx->parent = ctx->parent->parent;
+ }
+ ;
+
+value:
+ simple_value
+ | array
+ | list
+ | group
+ ;
+
+string:
+ TOK_STRING { libconfig_parsectx_append_string(ctx, $1); free($1); }
+ | string TOK_STRING { libconfig_parsectx_append_string(ctx, $2); free($2); }
+ ;
+
+simple_value:
+ TOK_BOOLEAN
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_bool_elem(ctx->parent, -1,
+ (int)$1);
+
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ config_setting_set_bool(ctx->setting, (int)$1);
+ }
+ | TOK_INTEGER
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, $1);
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_DEFAULT);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int(ctx->setting, $1);
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT);
+ }
+ }
+ | TOK_INTEGER64
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, $1);
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_DEFAULT);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int64(ctx->setting, $1);
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT);
+ }
+ }
+ | TOK_HEX
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, $1);
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_HEX);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int(ctx->setting, $1);
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX);
+ }
+ }
+ | TOK_HEX64
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, $1);
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ config_setting_set_format(e, CONFIG_FORMAT_HEX);
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ config_setting_set_int64(ctx->setting, $1);
+ config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX);
+ }
+ }
+ | TOK_FLOAT
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ config_setting_t *e = config_setting_set_float_elem(ctx->parent, -1, $1);
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ config_setting_set_float(ctx->setting, $1);
+ }
+ | string
+ {
+ if(IN_ARRAY() || IN_LIST())
+ {
+ const char *s = libconfig_parsectx_take_string(ctx);
+ config_setting_t *e = config_setting_set_string_elem(ctx->parent, -1, s);
+ __delete(s);
+
+ if(! e)
+ {
+ libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
+ YYABORT;
+ }
+ else
+ {
+ CAPTURE_PARSE_POS(e);
+ }
+ }
+ else
+ {
+ const char *s = libconfig_parsectx_take_string(ctx);
+ config_setting_set_string(ctx->setting, s);
+ __delete(s);
+ }
+ }
+ ;
+
+value_list:
+ value
+ | value_list TOK_COMMA value
+ | value_list TOK_COMMA
+ ;
+
+value_list_optional:
+ /* empty */
+ | value_list
+ ;
+
+simple_value_list:
+ simple_value
+ | simple_value_list TOK_COMMA simple_value
+ | simple_value_list TOK_COMMA
+ ;
+
+simple_value_list_optional:
+ /* empty */
+ | simple_value_list
+ ;
+
+group:
+ TOK_GROUP_START
+ {
+ if(IN_LIST())
+ {
+ ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_GROUP);
+ CAPTURE_PARSE_POS(ctx->parent);
+ }
+ else
+ {
+ ctx->setting->type = CONFIG_TYPE_GROUP;
+ ctx->parent = ctx->setting;
+ ctx->setting = NULL;
+ }
+ }
+ setting_list_optional
+ TOK_GROUP_END
+ {
+ if(ctx->parent)
+ ctx->parent = ctx->parent->parent;
+ }
+ ;
+
+%%
diff --git a/lib/libconfig++.pc.in b/lib/libconfig++.pc.in
new file mode 100644
index 0000000..2771cc9
--- /dev/null
+++ b/lib/libconfig++.pc.in
@@ -0,0 +1,14 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libconfig++
+Description: C++ Configuration File Library
+Version: @VERSION@
+URL: http://www.hyperrealm.com/main.php?s=libconfig
+Requires:
+Conflicts:
+Libs: -L${libdir} -lconfig++
+Libs.private: @LIBS@
+Cflags: -I${includedir}
diff --git a/lib/libconfig++.vcproj b/lib/libconfig++.vcproj
new file mode 100644
index 0000000..6f8cf24
--- /dev/null
+++ b/lib/libconfig++.vcproj
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libconfig++"
+ ProjectGUID="{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}"
+ RootNamespace="libconfig_c"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="lib"
+ PreprocessorDefinitions="LIBCONFIGXX_EXPORTS;LIBCONFIG_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Shlwapi.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_d.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="lib"
+ PreprocessorDefinitions="LIBCONFIGXX_EXPORTS;LIBCONFIG_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H"
+ RuntimeLibrary="2"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Shlwapi.lib"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\grammar.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libconfig.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libconfigcpp.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\scanctx.c"
+ >
+ </File>
+ <File
+ RelativePath=".\scanner.c"
+ >
+ </File>
+ <File
+ RelativePath=".\strbuf.c"
+ >
+ </File>
+ <File
+ RelativePath=".\strvec.c"
+ >
+ </File>
+ <File
+ RelativePath=".\util.c"
+ >
+ </File>
+ <File
+ RelativePath=".\wincompat.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\ac_config.h"
+ >
+ </File>
+ <File
+ RelativePath=".\grammar.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libconfig.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libconfig.hh"
+ >
+ </File>
+ <File
+ RelativePath=".\parsectx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\scanctx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\scanner.h"
+ >
+ </File>
+ <File
+ RelativePath=".\win32\stdint.h"
+ >
+ </File>
+ <File
+ RelativePath=".\strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath=".\strvec.h"
+ >
+ </File>
+ <File
+ RelativePath=".\util.h"
+ >
+ </File>
+ <File
+ RelativePath=".\wincompat.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/lib/libconfig++.vcxproj b/lib/libconfig++.vcxproj
new file mode 100644
index 0000000..0983b19
--- /dev/null
+++ b/lib/libconfig++.vcxproj
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}</ProjectGuid>
+ <RootNamespace>libconfig_c</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <LinkIncremental>true</LinkIncremental>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <LinkIncremental>true</LinkIncremental>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;LIBCONFIGXX_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN64;LIBCONFIGXX_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;LIBCONFIGXX_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName)_d.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN64;LIBCONFIGXX_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName)_d.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;LIBCONFIGXX_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN64;LIBCONFIGXX_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;LIBCONFIGXX_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;WIN64;LIBCONFIGXX_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="grammar.c" />
+ <ClCompile Include="libconfig.c" />
+ <ClCompile Include="libconfigcpp.cc" />
+ <ClCompile Include="scanctx.c" />
+ <ClCompile Include="scanner.c" />
+ <ClCompile Include="strbuf.c" />
+ <ClCompile Include="strvec.c" />
+ <ClCompile Include="util.c" />
+ <ClCompile Include="wincompat.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\ac_config.h" />
+ <ClInclude Include="grammar.h" />
+ <ClInclude Include="libconfig.h" />
+ <ClInclude Include="parsectx.h" />
+ <ClInclude Include="scanctx.h" />
+ <ClInclude Include="scanner.h" />
+ <ClInclude Include="strbuf.h" />
+ <ClInclude Include="strvec.h" />
+ <ClInclude Include="util.h" />
+ <ClInclude Include="win32\stdint.h" />
+ <ClInclude Include="wincompat.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="libconfig.hh" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/lib/libconfig++.vcxproj.filters b/lib/libconfig++.vcxproj.filters
new file mode 100644
index 0000000..3ffe9cc
--- /dev/null
+++ b/lib/libconfig++.vcxproj.filters
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="grammar.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="libconfig.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="libconfigcpp.cc">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="scanctx.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="scanner.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="strbuf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="strvec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="util.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\ac_config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="grammar.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="libconfig.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="parsectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="scanctx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="scanner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="win32\stdint.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="strbuf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="strvec.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="util.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="wincompat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="libconfig.hh">
+ <Filter>Header Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/lib/libconfig++Config.cmake.in b/lib/libconfig++Config.cmake.in
new file mode 100644
index 0000000..b0ba418
--- /dev/null
+++ b/lib/libconfig++Config.cmake.in
@@ -0,0 +1,7 @@
+set(LIBCONFIG++_FOUND 1)
+set(LIBCONFIG++_VERSION "1.7")
+set(LIBCONFIG++_LIBRARIES "config++")
+set(LIBCONFIG++_LIBRARY_DIRS "@libdir@")
+set(LIBCONFIG++_LDFLAGS "")
+set(LIBCONFIG++_INCLUDE_DIRS "@includedir@")
+set(LIBCONFIG++_CFLAGS "")
diff --git a/lib/libconfig.c b/lib/libconfig.c
new file mode 100644
index 0000000..2f3cbfa
--- /dev/null
+++ b/lib/libconfig.c
@@ -0,0 +1,1777 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "ac_config.h"
+#endif
+
+#include <locale.h>
+
+#if defined(HAVE_XLOCALE_H) || defined(__APPLE__)
+#include <xlocale.h>
+#endif
+
+#include <ctype.h>
+#include <float.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "libconfig.h"
+#include "parsectx.h"
+#include "scanctx.h"
+#include "strvec.h"
+#include "wincompat.h"
+#include "grammar.h"
+#include "scanner.h"
+#include "util.h"
+
+#define PATH_TOKENS ":./"
+#define CHUNK_SIZE 16
+#define DEFAULT_TAB_WIDTH 2
+#define DEFAULT_FLOAT_PRECISION 6
+
+/* ------------------------------------------------------------------------- */
+
+#ifndef LIBCONFIG_STATIC
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+ || defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ return(TRUE);
+}
+
+#endif /* WIN32 || WIN64 */
+#endif /* LIBCONFIG_STATIC */
+
+/* ------------------------------------------------------------------------- */
+
+static const char *__io_error = "file I/O error";
+
+static void __config_list_destroy(config_list_t *list);
+static void __config_write_setting(const config_t *config,
+ const config_setting_t *setting,
+ FILE *stream, int depth);
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_locale_override(void)
+{
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) \
+ && ! defined(__MINGW32__)
+
+ _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
+ setlocale(LC_NUMERIC, "C");
+
+#elif defined(__APPLE__)
+
+ locale_t loc = newlocale(LC_NUMERIC_MASK, "C", NULL);
+ uselocale(loc);
+
+#elif ((defined HAVE_NEWLOCALE) && (defined HAVE_USELOCALE))
+
+ locale_t loc = newlocale(LC_NUMERIC, "C", NULL);
+ uselocale(loc);
+
+#else
+
+#warning "No way to modify calling thread's locale!"
+
+#endif
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_locale_restore(void)
+{
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) \
+ && ! defined(__MINGW32__)
+
+ _configthreadlocale(_DISABLE_PER_THREAD_LOCALE);
+
+#elif ((defined HAVE_USELOCALE) && (defined HAVE_FREELOCALE))
+
+ locale_t loc = uselocale(LC_GLOBAL_LOCALE);
+ freelocale(loc);
+
+#else
+
+#warning "No way to modify calling thread's locale!"
+
+#endif
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_name_compare(const char *a, const char *b)
+{
+ const char *p, *q;
+
+ for(p = a, q = b; ; p++, q++)
+ {
+ int pd = ((! *p) || strchr(PATH_TOKENS, *p));
+ int qd = ((! *q) || strchr(PATH_TOKENS, *q));
+
+ if(pd && qd)
+ break;
+ else if(pd)
+ return(-1);
+ else if(qd)
+ return(1);
+ else if(*p < *q)
+ return(-1);
+ else if(*p > *q)
+ return(1);
+ }
+
+ return(0);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_indent(FILE *stream, int depth, unsigned short w)
+{
+ if(w)
+ fprintf(stream, "%*s", (depth - 1) * w, " ");
+ else
+ {
+ int i;
+ for(i = 0; i < (depth - 1); ++i)
+ fputc('\t', stream);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_write_value(const config_t *config,
+ const config_value_t *value, int type,
+ int format, int depth, FILE *stream)
+{
+ char fbuf[64];
+
+ switch(type)
+ {
+ /* boolean */
+ case CONFIG_TYPE_BOOL:
+ fputs(value->ival ? "true" : "false", stream);
+ break;
+
+ /* int */
+ case CONFIG_TYPE_INT:
+ switch(format)
+ {
+ case CONFIG_FORMAT_HEX:
+ fprintf(stream, "0x%X", value->ival);
+ break;
+
+ case CONFIG_FORMAT_DEFAULT:
+ default:
+ fprintf(stream, "%d", value->ival);
+ break;
+ }
+ break;
+
+ /* 64-bit int */
+ case CONFIG_TYPE_INT64:
+ switch(format)
+ {
+ case CONFIG_FORMAT_HEX:
+ fprintf(stream, "0x" INT64_HEX_FMT "L", value->llval);
+ break;
+
+ case CONFIG_FORMAT_DEFAULT:
+ default:
+ fprintf(stream, INT64_FMT "L", value->llval);
+ break;
+ }
+ break;
+
+ /* float */
+ case CONFIG_TYPE_FLOAT:
+ {
+ const int sci_ok = config_get_option(
+ config, CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION);
+ libconfig_format_double(value->fval, config->float_precision, sci_ok,
+ fbuf, sizeof(fbuf));
+ fputs(fbuf, stream);
+ break;
+ }
+
+ /* string */
+ case CONFIG_TYPE_STRING:
+ {
+ char *p;
+
+ fputc('\"', stream);
+
+ if(value->sval)
+ {
+ for(p = value->sval; *p; p++)
+ {
+ int c = (int)*p & 0xFF;
+ switch(c)
+ {
+ case '\"':
+ case '\\':
+ fputc('\\', stream);
+ fputc(c, stream);
+ break;
+
+ case '\n':
+ fputs("\\n", stream);
+ break;
+
+ case '\r':
+ fputs("\\r", stream);
+ break;
+
+ case '\f':
+ fputs("\\f", stream);
+ break;
+
+ case '\t':
+ fputs("\\t", stream);
+ break;
+
+ default:
+ if(c >= ' ')
+ fputc(c, stream);
+ else
+ fprintf(stream, "\\x%02X", c);
+ }
+ }
+ }
+ fputc('\"', stream);
+ break;
+ }
+
+ /* list */
+ case CONFIG_TYPE_LIST:
+ {
+ config_list_t *list = value->list;
+
+ fputs("( ", stream);
+
+ if(list)
+ {
+ int len = list->length;
+ config_setting_t **s;
+
+ for(s = list->elements; len--; s++)
+ {
+ __config_write_value(config, &((*s)->value), (*s)->type,
+ config_setting_get_format(*s), depth + 1,
+ stream);
+
+ if(len)
+ fputc(',', stream);
+
+ fputc(' ', stream);
+ }
+ }
+
+ fputc(')', stream);
+ break;
+ }
+
+ /* array */
+ case CONFIG_TYPE_ARRAY:
+ {
+ config_list_t *list = value->list;
+
+ fputs("[ ", stream);
+
+ if(list)
+ {
+ int len = list->length;
+ config_setting_t **s;
+
+ for(s = list->elements; len--; s++)
+ {
+ __config_write_value(config, &((*s)->value), (*s)->type,
+ config_setting_get_format(*s), depth + 1,
+ stream);
+
+ if(len)
+ fputc(',', stream);
+
+ fputc(' ', stream);
+ }
+ }
+
+ fputc(']', stream);
+ break;
+ }
+
+ /* group */
+ case CONFIG_TYPE_GROUP:
+ {
+ config_list_t *list = value->list;
+
+ if(depth > 0)
+ {
+ if(config_get_option(config, CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE))
+ {
+ fputc('\n', stream);
+
+ if(depth > 1)
+ __config_indent(stream, depth, config->tab_width);
+ }
+
+ fputs("{\n", stream);
+ }
+
+ if(list)
+ {
+ int len = list->length;
+ config_setting_t **s;
+
+ for(s = list->elements; len--; s++)
+ __config_write_setting(config, *s, stream, depth + 1);
+ }
+
+ if(depth > 1)
+ __config_indent(stream, depth, config->tab_width);
+
+ if(depth > 0)
+ fputc('}', stream);
+
+ break;
+ }
+
+ default:
+ /* this shouldn't happen, but handle it gracefully... */
+ fputs("???", stream);
+ break;
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_list_add(config_list_t *list, config_setting_t *setting)
+{
+ if((list->length % CHUNK_SIZE) == 0)
+ {
+ list->elements = (config_setting_t **)realloc(
+ list->elements,
+ (list->length + CHUNK_SIZE) * sizeof(config_setting_t *));
+ }
+
+ list->elements[list->length] = setting;
+ list->length++;
+}
+
+/* ------------------------------------------------------------------------- */
+
+static config_setting_t *__config_list_search(config_list_t *list,
+ const char *name,
+ unsigned int *idx)
+{
+ config_setting_t **found = NULL;
+ unsigned int i;
+
+ if(! list)
+ return(NULL);
+
+ for(i = 0, found = list->elements; i < list->length; i++, found++)
+ {
+ if(! (*found)->name)
+ continue;
+
+ if(! __config_name_compare(name, (*found)->name))
+ {
+ if(idx)
+ *idx = i;
+
+ return(*found);
+ }
+ }
+
+ return(NULL);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static config_setting_t *__config_list_remove(config_list_t *list, int idx)
+{
+ config_setting_t *removed = *(list->elements + idx);
+ int offset = (idx * sizeof(config_setting_t *));
+ int len = list->length - 1 - idx;
+ char *base = (char *)list->elements + offset;
+
+ memmove(base, base + sizeof(config_setting_t *),
+ len * sizeof(config_setting_t *));
+
+ list->length--;
+
+ /* possibly realloc smaller? */
+
+ return(removed);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_setting_destroy(config_setting_t *setting)
+{
+ if(setting)
+ {
+ if(setting->name)
+ __delete(setting->name);
+
+ if(setting->type == CONFIG_TYPE_STRING)
+ __delete(setting->value.sval);
+
+ else if(config_setting_is_aggregate(setting))
+ {
+ if(setting->value.list)
+ __config_list_destroy(setting->value.list);
+ }
+
+ if(setting->hook && setting->config->destructor)
+ setting->config->destructor(setting->hook);
+
+ __delete(setting);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_list_destroy(config_list_t *list)
+{
+ config_setting_t **p;
+ unsigned int i;
+
+ if(! list)
+ return;
+
+ if(list->elements)
+ {
+ for(p = list->elements, i = 0; i < list->length; p++, i++)
+ __config_setting_destroy(*p);
+
+ __delete(list->elements);
+ }
+
+ __delete(list);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_list_checktype(const config_setting_t *setting, int type)
+{
+ /* if the array is empty, then it has no type yet */
+
+ if(! setting->value.list)
+ return(CONFIG_TRUE);
+
+ if(setting->value.list->length == 0)
+ return(CONFIG_TRUE);
+
+ /* if it's a list, any type is allowed */
+
+ if(setting->type == CONFIG_TYPE_LIST)
+ return(CONFIG_TRUE);
+
+ /* otherwise the first element added determines the type of the array */
+
+ return((setting->value.list->elements[0]->type == type)
+ ? CONFIG_TRUE : CONFIG_FALSE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_type_is_scalar(int type)
+{
+ return((type >= CONFIG_TYPE_INT) && (type <= CONFIG_TYPE_BOOL));
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_validate_name(const char *name)
+{
+ const char *p = name;
+
+ if(*p == '\0')
+ return(CONFIG_FALSE);
+
+ if(! isalpha((int)*p) && (*p != '*'))
+ return(CONFIG_FALSE);
+
+ for(++p; *p; ++p)
+ {
+ if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-", (int)*p)))
+ return(CONFIG_FALSE);
+ }
+
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_read(config_t *config, FILE *stream, const char *filename,
+ const char *str)
+{
+ yyscan_t scanner;
+ struct scan_context scan_ctx;
+ struct parse_context parse_ctx;
+ int r;
+
+ config_clear(config);
+
+ libconfig_parsectx_init(&parse_ctx);
+ parse_ctx.config = config;
+ parse_ctx.parent = config->root;
+ parse_ctx.setting = config->root;
+
+ __config_locale_override();
+
+ libconfig_scanctx_init(&scan_ctx, filename);
+ config->root->file = libconfig_scanctx_current_filename(&scan_ctx);
+ scan_ctx.config = config;
+ libconfig_yylex_init_extra(&scan_ctx, &scanner);
+
+ if(stream)
+ libconfig_yyrestart(stream, scanner);
+ else /* read from string */
+ (void)libconfig_yy_scan_string(str, scanner);
+
+ libconfig_yyset_lineno(1, scanner);
+ r = libconfig_yyparse(scanner, &parse_ctx, &scan_ctx);
+
+ if(r != 0)
+ {
+ YY_BUFFER_STATE buf;
+
+ config->error_file = libconfig_scanctx_current_filename(&scan_ctx);
+ config->error_type = CONFIG_ERR_PARSE;
+
+ /* Unwind the include stack, freeing the buffers and closing the files. */
+ while((buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(&scan_ctx))
+ != NULL)
+ libconfig_yy_delete_buffer(buf, scanner);
+ }
+
+ libconfig_yylex_destroy(scanner);
+ config->filenames = libconfig_scanctx_cleanup(&scan_ctx);
+ libconfig_parsectx_cleanup(&parse_ctx);
+
+ __config_locale_restore();
+
+ return(r == 0 ? CONFIG_TRUE : CONFIG_FALSE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_read(config_t *config, FILE *stream)
+{
+ return(__config_read(config, stream, NULL, NULL));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_read_string(config_t *config, const char *str)
+{
+ return(__config_read(config, NULL, NULL, str));
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void __config_write_setting(const config_t *config,
+ const config_setting_t *setting,
+ FILE *stream, int depth)
+{
+ char group_assign_char = config_get_option(
+ config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS) ? ':' : '=';
+
+ char nongroup_assign_char = config_get_option(
+ config, CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS) ? ':' : '=';
+
+ if(depth > 1)
+ __config_indent(stream, depth, config->tab_width);
+
+
+ if(setting->name)
+ {
+ fputs(setting->name, stream);
+ fprintf(stream, " %c ", ((setting->type == CONFIG_TYPE_GROUP)
+ ? group_assign_char
+ : nongroup_assign_char));
+ }
+
+ __config_write_value(config, &(setting->value), setting->type,
+ config_setting_get_format(setting), depth, stream);
+
+ if(depth > 0)
+ {
+ if(config_get_option(config, CONFIG_OPTION_SEMICOLON_SEPARATORS))
+ fputc(';', stream);
+
+ fputc('\n', stream);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_write(const config_t *config, FILE *stream)
+{
+ __config_locale_override();
+
+ __config_write_setting(config, config->root, stream, 0);
+
+ __config_locale_restore();
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_read_file(config_t *config, const char *filename)
+{
+ int ret, ok = 0;
+
+ FILE *stream = fopen(filename, "rt");
+ if(stream != NULL)
+ {
+ // On some operating systems, fopen() succeeds on a directory.
+ int fd = fileno(stream);
+ struct stat statbuf;
+
+ if(fstat(fd, &statbuf) == 0)
+ {
+ // Only proceed if this is not a directory.
+ if(!S_ISDIR(statbuf.st_mode))
+ ok = 1;
+ }
+ }
+
+ if(!ok)
+ {
+ if(stream != NULL)
+ fclose(stream);
+
+ config->error_text = __io_error;
+ config->error_type = CONFIG_ERR_FILE_IO;
+ return(CONFIG_FALSE);
+ }
+
+ ret = __config_read(config, stream, filename, NULL);
+ fclose(stream);
+
+ return(ret);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_write_file(config_t *config, const char *filename)
+{
+ FILE *stream = fopen(filename, "wt");
+ if(stream == NULL)
+ {
+ config->error_text = __io_error;
+ config->error_type = CONFIG_ERR_FILE_IO;
+ return(CONFIG_FALSE);
+ }
+
+ config_write(config, stream);
+
+ if(config_get_option(config, CONFIG_OPTION_FSYNC))
+ {
+ int fd = fileno(stream);
+
+ if(fd >= 0)
+ {
+ if(fsync(fd) != 0)
+ {
+ fclose(stream);
+ config->error_text = __io_error;
+ config->error_type = CONFIG_ERR_FILE_IO;
+ return(CONFIG_FALSE);
+ }
+ }
+ }
+
+ fclose(stream);
+ config->error_type = CONFIG_ERR_NONE;
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_destroy(config_t *config)
+{
+ __config_setting_destroy(config->root);
+ libconfig_strvec_delete(config->filenames);
+ __delete(config->include_dir);
+ __zero(config);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_clear(config_t *config)
+{
+ /* Destroy the root setting (recursively) and then create a new one. */
+ __config_setting_destroy(config->root);
+
+ libconfig_strvec_delete(config->filenames);
+ config->filenames = NULL;
+
+ config->root = __new(config_setting_t);
+ config->root->type = CONFIG_TYPE_GROUP;
+ config->root->config = config;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_tab_width(config_t *config, unsigned short width)
+{
+ /* As per documentation: valid range is 0 - 15. */
+ config->tab_width = (width <= 15) ? width : 15;
+}
+
+/* ------------------------------------------------------------------------- */
+
+unsigned short config_get_tab_width(const config_t *config)
+{
+ return config->tab_width;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_float_precision(config_t *config, unsigned short digits)
+{
+ config->float_precision = digits;
+}
+
+/* ------------------------------------------------------------------------- */
+
+unsigned short config_get_float_precision(const config_t *config)
+{
+ return config->float_precision;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_init(config_t *config)
+{
+ __zero(config);
+ config_clear(config);
+
+ /* Set default options. */
+ config->options = (CONFIG_OPTION_SEMICOLON_SEPARATORS
+ | CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS
+ | CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE);
+ config->tab_width = DEFAULT_TAB_WIDTH;
+ config->float_precision = DEFAULT_FLOAT_PRECISION;
+ config->include_fn = config_default_include_func;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_options(config_t *config, int options)
+{
+ config->options = options;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_get_options(const config_t *config)
+{
+ return(config->options);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_option(config_t *config, int option, int flag)
+{
+ if(flag)
+ config->options |= option;
+ else
+ config->options &= ~option;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_get_option(const config_t *config, int option)
+{
+ return((config->options & option) == option);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_hook(config_t *config, void *hook)
+{
+ config->hook = hook;
+}
+
+/* ------------------------------------------------------------------------- */
+
+static config_setting_t *config_setting_create(config_setting_t *parent,
+ const char *name, int type)
+{
+ config_setting_t *setting;
+ config_list_t *list;
+
+ if(!config_setting_is_aggregate(parent))
+ return(NULL);
+
+ setting = __new(config_setting_t);
+ setting->parent = parent;
+ setting->name = (name == NULL) ? NULL : strdup(name);
+ setting->type = type;
+ setting->config = parent->config;
+ setting->hook = NULL;
+ setting->line = 0;
+
+ list = parent->value.list;
+
+ if(! list)
+ list = parent->value.list = __new(config_list_t);
+
+ __config_list_add(list, setting);
+
+ return(setting);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_setting_get_int(const config_setting_t *setting,
+ int *value)
+{
+ switch(setting->type)
+ {
+ case CONFIG_TYPE_INT:
+ *value = setting->value.ival;
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_INT64:
+ if((setting->value.llval >= INT_MIN)
+ && (setting->value.llval <= INT_MAX))
+ {
+ *value = (int)(setting->value.llval);
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ case CONFIG_TYPE_FLOAT:
+ if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT))
+ {
+ *value = (int)(setting->value.fval);
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ default:
+ return(CONFIG_FALSE);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_get_int(const config_setting_t *setting)
+{
+ int value = 0;
+ __config_setting_get_int(setting, &value);
+ return(value);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_setting_get_int64(const config_setting_t *setting,
+ long long *value)
+{
+ switch(setting->type)
+ {
+ case CONFIG_TYPE_INT64:
+ *value = setting->value.llval;
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_INT:
+ *value = (long long)(setting->value.ival);
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_FLOAT:
+ if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT))
+ {
+ *value = (long long)(setting->value.fval);
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ default:
+ return(CONFIG_FALSE);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+long long config_setting_get_int64(const config_setting_t *setting)
+{
+ long long value = 0;
+ __config_setting_get_int64(setting, &value);
+ return(value);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_lookup_int(const config_setting_t *setting,
+ const char *name, int *value)
+{
+ config_setting_t *member = config_setting_get_member(setting, name);
+ if(! member)
+ return(CONFIG_FALSE);
+
+ return(__config_setting_get_int(member, value));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_lookup_int64(const config_setting_t *setting,
+ const char *name, long long *value)
+{
+ config_setting_t *member = config_setting_get_member(setting, name);
+ if(! member)
+ return(CONFIG_FALSE);
+
+ return(__config_setting_get_int64(member, value));
+}
+
+/* ------------------------------------------------------------------------- */
+
+static int __config_setting_get_float(const config_setting_t *setting,
+ double *value)
+{
+ switch(setting->type)
+ {
+ case CONFIG_TYPE_FLOAT:
+ *value = setting->value.fval;
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_INT:
+ if(config_get_auto_convert(setting->config))
+ {
+ *value = (double)(setting->value.ival);
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ case CONFIG_TYPE_INT64:
+ if(config_get_auto_convert(setting->config))
+ {
+ *value = (double)(setting->value.llval);
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ default:
+ return(CONFIG_FALSE);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+double config_setting_get_float(const config_setting_t *setting)
+{
+ double value = 0.0;
+ __config_setting_get_float(setting, &value);
+ return(value);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_lookup_float(const config_setting_t *setting,
+ const char *name, double *value)
+{
+ config_setting_t *member = config_setting_get_member(setting, name);
+ if(! member)
+ return(CONFIG_FALSE);
+
+ return(__config_setting_get_float(member, value));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_lookup_string(const config_setting_t *setting,
+ const char *name, const char **value)
+{
+ config_setting_t *member = config_setting_get_member(setting, name);
+ if(! member)
+ return(CONFIG_FALSE);
+
+ if(config_setting_type(member) != CONFIG_TYPE_STRING)
+ return(CONFIG_FALSE);
+
+ *value = config_setting_get_string(member);
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_lookup_bool(const config_setting_t *setting,
+ const char *name, int *value)
+{
+ config_setting_t *member = config_setting_get_member(setting, name);
+ if(! member)
+ return(CONFIG_FALSE);
+
+ if(config_setting_type(member) != CONFIG_TYPE_BOOL)
+ return(CONFIG_FALSE);
+
+ *value = config_setting_get_bool(member);
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_set_int(config_setting_t *setting, int value)
+{
+ switch(setting->type)
+ {
+ case CONFIG_TYPE_NONE:
+ setting->type = CONFIG_TYPE_INT;
+ /* fall through */
+
+ case CONFIG_TYPE_INT:
+ setting->value.ival = value;
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_FLOAT:
+ if(config_get_auto_convert(setting->config))
+ {
+ setting->value.fval = (float)value;
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ default:
+ return(CONFIG_FALSE);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_set_int64(config_setting_t *setting, long long value)
+{
+ switch(setting->type)
+ {
+ case CONFIG_TYPE_NONE:
+ setting->type = CONFIG_TYPE_INT64;
+ /* fall through */
+
+ case CONFIG_TYPE_INT64:
+ setting->value.llval = value;
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_INT:
+ if((value >= INT_MIN) && (value <= INT_MAX))
+ {
+ setting->value.ival = (int)value;
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ case CONFIG_TYPE_FLOAT:
+ if(config_get_auto_convert(setting->config))
+ {
+ setting->value.fval = (float)value;
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ default:
+ return(CONFIG_FALSE);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_set_float(config_setting_t *setting, double value)
+{
+ switch(setting->type)
+ {
+ case CONFIG_TYPE_NONE:
+ setting->type = CONFIG_TYPE_FLOAT;
+ /* fall through */
+
+ case CONFIG_TYPE_FLOAT:
+ setting->value.fval = value;
+ return(CONFIG_TRUE);
+
+ case CONFIG_TYPE_INT:
+ if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT))
+ {
+ setting->value.ival = (int)value;
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ case CONFIG_TYPE_INT64:
+ if(config_get_option(setting->config, CONFIG_OPTION_AUTOCONVERT))
+ {
+ setting->value.llval = (long long)value;
+ return(CONFIG_TRUE);
+ }
+ else
+ return(CONFIG_FALSE);
+
+ default:
+ return(CONFIG_FALSE);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_get_bool(const config_setting_t *setting)
+{
+ return((setting->type == CONFIG_TYPE_BOOL) ? setting->value.ival : 0);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_set_bool(config_setting_t *setting, int value)
+{
+ if(setting->type == CONFIG_TYPE_NONE)
+ setting->type = CONFIG_TYPE_BOOL;
+ else if(setting->type != CONFIG_TYPE_BOOL)
+ return(CONFIG_FALSE);
+
+ setting->value.ival = value;
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+const char *config_setting_get_string(const config_setting_t *setting)
+{
+ return((setting->type == CONFIG_TYPE_STRING) ? setting->value.sval : NULL);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_set_string(config_setting_t *setting, const char *value)
+{
+ if(setting->type == CONFIG_TYPE_NONE)
+ setting->type = CONFIG_TYPE_STRING;
+ else if(setting->type != CONFIG_TYPE_STRING)
+ return(CONFIG_FALSE);
+
+ if(setting->value.sval)
+ __delete(setting->value.sval);
+
+ setting->value.sval = (value == NULL) ? NULL : strdup(value);
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_set_format(config_setting_t *setting, short format)
+{
+ if(((setting->type != CONFIG_TYPE_INT)
+ && (setting->type != CONFIG_TYPE_INT64))
+ || ((format != CONFIG_FORMAT_DEFAULT) && (format != CONFIG_FORMAT_HEX)))
+ return(CONFIG_FALSE);
+
+ setting->format = format;
+
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+short config_setting_get_format(const config_setting_t *setting)
+{
+ return(setting->format != 0 ? setting->format
+ : setting->config->default_format);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_lookup(config_setting_t *setting,
+ const char *path)
+{
+ const char *p = path;
+ config_setting_t *found = setting;
+
+ for(;;)
+ {
+ while(*p && strchr(PATH_TOKENS, *p))
+ p++;
+
+ if(! *p)
+ break;
+
+ if(*p == '[')
+ found = config_setting_get_elem(found, atoi(++p));
+ else
+ found = config_setting_get_member(found, p);
+
+ if(! found)
+ break;
+
+ while(! strchr(PATH_TOKENS, *p))
+ p++;
+ }
+
+ return(*p || (found == setting) ? NULL : found);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_lookup(const config_t *config, const char *path)
+{
+ return(config_setting_lookup(config->root, path));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_lookup_string(const config_t *config, const char *path,
+ const char **value)
+{
+ const config_setting_t *s = config_lookup(config, path);
+ if(! s)
+ return(CONFIG_FALSE);
+
+ if(config_setting_type(s) != CONFIG_TYPE_STRING)
+ return(CONFIG_FALSE);
+
+ *value = config_setting_get_string(s);
+
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_lookup_int(const config_t *config, const char *path,
+ int *value)
+{
+ const config_setting_t *s = config_lookup(config, path);
+ if(! s)
+ return(CONFIG_FALSE);
+
+ return(__config_setting_get_int(s, value));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_lookup_int64(const config_t *config, const char *path,
+ long long *value)
+{
+ const config_setting_t *s = config_lookup(config, path);
+ if(! s)
+ return(CONFIG_FALSE);
+
+ return(__config_setting_get_int64(s, value));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_lookup_float(const config_t *config, const char *path,
+ double *value)
+{
+ const config_setting_t *s = config_lookup(config, path);
+ if(! s)
+ return(CONFIG_FALSE);
+
+ return(__config_setting_get_float(s, value));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_lookup_bool(const config_t *config, const char *path, int *value)
+{
+ const config_setting_t *s = config_lookup(config, path);
+ if(! s)
+ return(CONFIG_FALSE);
+
+ if(config_setting_type(s) != CONFIG_TYPE_BOOL)
+ return(CONFIG_FALSE);
+
+ *value = config_setting_get_bool(s);
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_get_int_elem(const config_setting_t *setting, int idx)
+{
+ const config_setting_t *element = config_setting_get_elem(setting, idx);
+
+ return(element ? config_setting_get_int(element) : 0);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_set_int_elem(config_setting_t *setting,
+ int idx, int value)
+{
+ config_setting_t *element = NULL;
+
+ if((setting->type != CONFIG_TYPE_ARRAY)
+ && (setting->type != CONFIG_TYPE_LIST))
+ return(NULL);
+
+ if(idx < 0)
+ {
+ if(! __config_list_checktype(setting, CONFIG_TYPE_INT))
+ return(NULL);
+
+ element = config_setting_create(setting, NULL, CONFIG_TYPE_INT);
+ }
+ else
+ {
+ element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(NULL);
+ }
+
+ if(! config_setting_set_int(element, value))
+ return(NULL);
+
+ return(element);
+}
+
+/* ------------------------------------------------------------------------- */
+
+long long config_setting_get_int64_elem(const config_setting_t *setting,
+ int idx)
+{
+ const config_setting_t *element = config_setting_get_elem(setting, idx);
+
+ return(element ? config_setting_get_int64(element) : 0);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_set_int64_elem(config_setting_t *setting,
+ int idx, long long value)
+{
+ config_setting_t *element = NULL;
+
+ if((setting->type != CONFIG_TYPE_ARRAY)
+ && (setting->type != CONFIG_TYPE_LIST))
+ return(NULL);
+
+ if(idx < 0)
+ {
+ if(! __config_list_checktype(setting, CONFIG_TYPE_INT64))
+ return(NULL);
+
+ element = config_setting_create(setting, NULL, CONFIG_TYPE_INT64);
+ }
+ else
+ {
+ element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(NULL);
+ }
+
+ if(! config_setting_set_int64(element, value))
+ return(NULL);
+
+ return(element);
+}
+
+/* ------------------------------------------------------------------------- */
+
+double config_setting_get_float_elem(const config_setting_t *setting, int idx)
+{
+ config_setting_t *element = config_setting_get_elem(setting, idx);
+
+ return(element ? config_setting_get_float(element) : 0.0);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_set_float_elem(config_setting_t *setting,
+ int idx, double value)
+{
+ config_setting_t *element = NULL;
+
+ if((setting->type != CONFIG_TYPE_ARRAY)
+ && (setting->type != CONFIG_TYPE_LIST))
+ return(NULL);
+
+ if(idx < 0)
+ {
+ if(! __config_list_checktype(setting, CONFIG_TYPE_FLOAT))
+ return(NULL);
+
+ element = config_setting_create(setting, NULL, CONFIG_TYPE_FLOAT);
+ }
+ else
+ element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(NULL);
+
+ if(! config_setting_set_float(element, value))
+ return(NULL);
+
+ return(element);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_get_bool_elem(const config_setting_t *setting, int idx)
+{
+ config_setting_t *element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(CONFIG_FALSE);
+
+ if(element->type != CONFIG_TYPE_BOOL)
+ return(CONFIG_FALSE);
+
+ return(element->value.ival);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_set_bool_elem(config_setting_t *setting,
+ int idx, int value)
+{
+ config_setting_t *element = NULL;
+
+ if((setting->type != CONFIG_TYPE_ARRAY)
+ && (setting->type != CONFIG_TYPE_LIST))
+ return(NULL);
+
+ if(idx < 0)
+ {
+ if(! __config_list_checktype(setting, CONFIG_TYPE_BOOL))
+ return(NULL);
+
+ element = config_setting_create(setting, NULL, CONFIG_TYPE_BOOL);
+ }
+ else
+ element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(NULL);
+
+ if(! config_setting_set_bool(element, value))
+ return(NULL);
+
+ return(element);
+}
+
+/* ------------------------------------------------------------------------- */
+
+const char *config_setting_get_string_elem(const config_setting_t *setting,
+ int idx)
+{
+ config_setting_t *element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(NULL);
+
+ if(element->type != CONFIG_TYPE_STRING)
+ return(NULL);
+
+ return(element->value.sval);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_set_string_elem(config_setting_t *setting,
+ int idx, const char *value)
+{
+ config_setting_t *element = NULL;
+
+ if((setting->type != CONFIG_TYPE_ARRAY)
+ && (setting->type != CONFIG_TYPE_LIST))
+ return(NULL);
+
+ if(idx < 0)
+ {
+ if(! __config_list_checktype(setting, CONFIG_TYPE_STRING))
+ return(NULL);
+
+ element = config_setting_create(setting, NULL, CONFIG_TYPE_STRING);
+ }
+ else
+ element = config_setting_get_elem(setting, idx);
+
+ if(! element)
+ return(NULL);
+
+ if(! config_setting_set_string(element, value))
+ return(NULL);
+
+ return(element);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_get_elem(const config_setting_t *setting,
+ unsigned int idx)
+{
+ config_list_t *list;
+
+ if(! config_setting_is_aggregate(setting))
+ return(NULL);
+
+ list = setting->value.list;
+ if(! list)
+ return(NULL);
+
+ if(idx >= list->length)
+ return(NULL);
+
+ return(list->elements[idx]);
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_get_member(const config_setting_t *setting,
+ const char *name)
+{
+ if(setting->type != CONFIG_TYPE_GROUP)
+ return(NULL);
+
+ return(__config_list_search(setting->value.list, name, NULL));
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_destructor(config_t *config, void (*destructor)(void *))
+{
+ config->destructor = destructor;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_include_dir(config_t *config, const char *include_dir)
+{
+ __delete(config->include_dir);
+ config->include_dir = strdup(include_dir);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_set_include_func(config_t *config, config_include_fn_t func)
+{
+ config->include_fn = func ? func : config_default_include_func;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_length(const config_setting_t *setting)
+{
+ if(! config_setting_is_aggregate(setting))
+ return(0);
+
+ if(! setting->value.list)
+ return(0);
+
+ return(setting->value.list->length);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void config_setting_set_hook(config_setting_t *setting, void *hook)
+{
+ setting->hook = hook;
+}
+
+/* ------------------------------------------------------------------------- */
+
+config_setting_t *config_setting_add(config_setting_t *parent,
+ const char *name, int type)
+{
+ if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST))
+ return(NULL);
+
+ if(! parent)
+ return(NULL);
+
+ if((parent->type == CONFIG_TYPE_ARRAY) && !__config_type_is_scalar(type))
+ return(NULL); /* only scalars can be added to arrays */
+
+ if((parent->type == CONFIG_TYPE_ARRAY) || (parent->type == CONFIG_TYPE_LIST))
+ name = NULL;
+
+ if(name)
+ {
+ if(! __config_validate_name(name))
+ return(NULL);
+ }
+
+ if(config_setting_get_member(parent, name) != NULL)
+ {
+ if(config_get_option(parent->config, CONFIG_OPTION_ALLOW_OVERRIDES))
+ config_setting_remove(parent, name);
+ else
+ return(NULL); /* already exists */
+ }
+
+ return(config_setting_create(parent, name, type));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_remove(config_setting_t *parent, const char *name)
+{
+ unsigned int idx;
+ config_setting_t *setting;
+ const char *settingName;
+ const char *lastFound;
+
+ if(! parent)
+ return(CONFIG_FALSE);
+
+ if(parent->type != CONFIG_TYPE_GROUP)
+ return(CONFIG_FALSE);
+
+ setting = config_setting_lookup(parent, name);
+ if(! setting)
+ return(CONFIG_FALSE);
+
+ settingName = name;
+ do
+ {
+ lastFound = settingName;
+ while(settingName && !strchr(PATH_TOKENS, *settingName))
+ ++settingName;
+
+ if(*settingName == '\0')
+ {
+ settingName = lastFound;
+ break;
+ }
+
+ }while(*++settingName);
+
+ if(!(setting = __config_list_search(setting->parent->value.list, settingName, &idx)))
+ return(CONFIG_FALSE);
+
+ __config_list_remove(setting->parent->value.list, idx);
+ __config_setting_destroy(setting);
+
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_remove_elem(config_setting_t *parent, unsigned int idx)
+{
+ config_list_t *list;
+ config_setting_t *removed = NULL;
+
+ if(! parent)
+ return(CONFIG_FALSE);
+
+ if(! config_setting_is_aggregate(parent))
+ return(CONFIG_FALSE);
+
+ list = parent->value.list;
+ if(! list)
+ return(CONFIG_FALSE);
+
+ if(idx >= list->length)
+ return(CONFIG_FALSE);
+
+ removed = __config_list_remove(list, idx);
+ __config_setting_destroy(removed);
+
+ return(CONFIG_TRUE);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_index(const config_setting_t *setting)
+{
+ config_setting_t **found = NULL;
+ config_list_t *list;
+ int i;
+
+ if(! setting->parent)
+ return(-1);
+
+ list = setting->parent->value.list;
+
+ for(i = 0, found = list->elements; i < (int)list->length; ++i, ++found)
+ {
+ if(*found == setting)
+ return(i);
+ }
+
+ return(-1);
+}
+
+/* ------------------------------------------------------------------------- */
+
+const char **config_default_include_func(config_t *config,
+ const char *include_dir,
+ const char *path,
+ const char **error)
+{
+ char *file;
+ const char **files;
+
+ if(include_dir && IS_RELATIVE_PATH(path))
+ {
+ file = (char *)malloc(strlen(include_dir) + strlen(path) + 2);
+ strcpy(file, include_dir);
+ strcat(file, FILE_SEPARATOR);
+ strcat(file, path);
+ }
+ else
+ file = strdup(path);
+
+ *error = NULL;
+
+ files = (const char **)malloc(sizeof(char **) * 2);
+ files[0] = file;
+ files[1] = NULL;
+
+ return(files);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_is_scalar(const config_setting_t *setting)
+{
+ return(__config_type_is_scalar(setting->type));
+}
+
+/* ------------------------------------------------------------------------- */
+
+int config_setting_is_aggregate(const config_setting_t *setting)
+{
+ return((setting->type == CONFIG_TYPE_ARRAY)
+ || (setting->type == CONFIG_TYPE_LIST)
+ || (setting->type == CONFIG_TYPE_GROUP));
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/lib/libconfig.h b/lib/libconfig.h
new file mode 100644
index 0000000..5e4eea3
--- /dev/null
+++ b/lib/libconfig.h
@@ -0,0 +1,355 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __libconfig_h
+#define __libconfig_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+#if defined(LIBCONFIG_STATIC)
+#define LIBCONFIG_API
+#elif defined(LIBCONFIG_EXPORTS)
+#define LIBCONFIG_API __declspec(dllexport)
+#else /* ! LIBCONFIG_EXPORTS */
+#define LIBCONFIG_API __declspec(dllimport)
+#endif /* LIBCONFIG_STATIC */
+#else /* ! WIN32 */
+#define LIBCONFIG_API
+#endif /* WIN32 */
+
+#define LIBCONFIG_VER_MAJOR 1
+#define LIBCONFIG_VER_MINOR 7
+#define LIBCONFIG_VER_REVISION 0
+
+#include <stdio.h>
+
+#define CONFIG_TYPE_NONE 0
+#define CONFIG_TYPE_GROUP 1
+#define CONFIG_TYPE_INT 2
+#define CONFIG_TYPE_INT64 3
+#define CONFIG_TYPE_FLOAT 4
+#define CONFIG_TYPE_STRING 5
+#define CONFIG_TYPE_BOOL 6
+#define CONFIG_TYPE_ARRAY 7
+#define CONFIG_TYPE_LIST 8
+
+#define CONFIG_FORMAT_DEFAULT 0
+#define CONFIG_FORMAT_HEX 1
+
+#define CONFIG_OPTION_AUTOCONVERT 0x01
+#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02
+#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04
+#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS 0x08
+#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10
+#define CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION 0x20
+#define CONFIG_OPTION_FSYNC 0x40
+#define CONFIG_OPTION_ALLOW_OVERRIDES 0x80
+
+#define CONFIG_TRUE (1)
+#define CONFIG_FALSE (0)
+
+typedef union config_value_t
+{
+ int ival;
+ long long llval;
+ double fval;
+ char *sval;
+ struct config_list_t *list;
+} config_value_t;
+
+typedef struct config_setting_t
+{
+ char *name;
+ short type;
+ short format;
+ config_value_t value;
+ struct config_setting_t *parent;
+ struct config_t *config;
+ void *hook;
+ unsigned int line;
+ const char *file;
+} config_setting_t;
+
+typedef enum
+{
+ CONFIG_ERR_NONE = 0,
+ CONFIG_ERR_FILE_IO = 1,
+ CONFIG_ERR_PARSE = 2
+} config_error_t;
+
+typedef struct config_list_t
+{
+ unsigned int length;
+ config_setting_t **elements;
+} config_list_t;
+
+typedef const char ** (*config_include_fn_t)(struct config_t *,
+ const char *,
+ const char *,
+ const char **);
+
+typedef struct config_t
+{
+ config_setting_t *root;
+ void (*destructor)(void *);
+ int options;
+ unsigned short tab_width;
+ unsigned short float_precision;
+ unsigned short default_format;
+ const char *include_dir;
+ config_include_fn_t include_fn;
+ const char *error_text;
+ const char *error_file;
+ int error_line;
+ config_error_t error_type;
+ const char **filenames;
+ void *hook;
+} config_t;
+
+extern LIBCONFIG_API int config_read(config_t *config, FILE *stream);
+extern LIBCONFIG_API void config_write(const config_t *config, FILE *stream);
+
+extern LIBCONFIG_API void config_set_default_format(config_t *config,
+ short format);
+
+extern LIBCONFIG_API void config_set_options(config_t *config, int options);
+extern LIBCONFIG_API int config_get_options(const config_t *config);
+
+extern LIBCONFIG_API void config_set_option(config_t *config, int option,
+ int flag);
+extern LIBCONFIG_API int config_get_option(const config_t *config, int option);
+
+extern LIBCONFIG_API int config_read_string(config_t *config, const char *str);
+
+extern LIBCONFIG_API int config_read_file(config_t *config,
+ const char *filename);
+extern LIBCONFIG_API int config_write_file(config_t *config,
+ const char *filename);
+
+extern LIBCONFIG_API void config_set_destructor(config_t *config,
+ void (*destructor)(void *));
+extern LIBCONFIG_API void config_set_include_dir(config_t *config,
+ const char *include_dir);
+extern LIBCONFIG_API void config_set_include_func(config_t *config,
+ config_include_fn_t func);
+
+extern LIBCONFIG_API void config_set_float_precision(config_t *config,
+ unsigned short digits);
+extern LIBCONFIG_API unsigned short config_get_float_precision(
+ const config_t *config);
+
+extern LIBCONFIG_API void config_set_tab_width(config_t *config,
+ unsigned short width);
+extern LIBCONFIG_API unsigned short config_get_tab_width(
+ const config_t *config);
+
+extern LIBCONFIG_API void config_set_hook(config_t *config, void *hook);
+
+#define config_get_hook(C) ((C)->hook)
+
+extern LIBCONFIG_API void config_init(config_t *config);
+extern LIBCONFIG_API void config_destroy(config_t *config);
+extern LIBCONFIG_API void config_clear(config_t *config);
+
+extern LIBCONFIG_API int config_setting_get_int(
+ const config_setting_t *setting);
+extern LIBCONFIG_API long long config_setting_get_int64(
+ const config_setting_t *setting);
+extern LIBCONFIG_API double config_setting_get_float(
+ const config_setting_t *setting);
+extern LIBCONFIG_API int config_setting_get_bool(
+ const config_setting_t *setting);
+extern LIBCONFIG_API const char *config_setting_get_string(
+ const config_setting_t *setting);
+
+extern LIBCONFIG_API int config_setting_lookup_int(
+ const config_setting_t *setting, const char *name, int *value);
+extern LIBCONFIG_API int config_setting_lookup_int64(
+ const config_setting_t *setting, const char *name, long long *value);
+extern LIBCONFIG_API int config_setting_lookup_float(
+ const config_setting_t *setting, const char *name, double *value);
+extern LIBCONFIG_API int config_setting_lookup_bool(
+ const config_setting_t *setting, const char *name, int *value);
+extern LIBCONFIG_API int config_setting_lookup_string(
+ const config_setting_t *setting, const char *name, const char **value);
+
+extern LIBCONFIG_API int config_setting_set_int(config_setting_t *setting,
+ int value);
+extern LIBCONFIG_API int config_setting_set_int64(config_setting_t *setting,
+ long long value);
+extern LIBCONFIG_API int config_setting_set_float(config_setting_t *setting,
+ double value);
+extern LIBCONFIG_API int config_setting_set_bool(config_setting_t *setting,
+ int value);
+extern LIBCONFIG_API int config_setting_set_string(config_setting_t *setting,
+ const char *value);
+
+extern LIBCONFIG_API int config_setting_set_format(config_setting_t *setting,
+ short format);
+extern LIBCONFIG_API short config_setting_get_format(
+ const config_setting_t *setting);
+
+extern LIBCONFIG_API int config_setting_get_int_elem(
+ const config_setting_t *setting, int idx);
+extern LIBCONFIG_API long long config_setting_get_int64_elem(
+ const config_setting_t *setting, int idx);
+extern LIBCONFIG_API double config_setting_get_float_elem(
+ const config_setting_t *setting, int idx);
+extern LIBCONFIG_API int config_setting_get_bool_elem(
+ const config_setting_t *setting, int idx);
+extern LIBCONFIG_API const char *config_setting_get_string_elem(
+ const config_setting_t *setting, int idx);
+
+extern LIBCONFIG_API config_setting_t *config_setting_set_int_elem(
+ config_setting_t *setting, int idx, int value);
+extern LIBCONFIG_API config_setting_t *config_setting_set_int64_elem(
+ config_setting_t *setting, int idx, long long value);
+extern LIBCONFIG_API config_setting_t *config_setting_set_float_elem(
+ config_setting_t *setting, int idx, double value);
+extern LIBCONFIG_API config_setting_t *config_setting_set_bool_elem(
+ config_setting_t *setting, int idx, int value);
+extern LIBCONFIG_API config_setting_t *config_setting_set_string_elem(
+ config_setting_t *setting, int idx, const char *value);
+
+extern LIBCONFIG_API const char **config_default_include_func(
+ config_t *config, const char *include_dir, const char *path,
+ const char **error);
+
+extern LIBCONFIG_API int config_setting_is_scalar(
+ const config_setting_t *setting);
+
+extern LIBCONFIG_API int config_setting_is_aggregate(
+ const config_setting_t *setting);
+
+#define /* const char * */ config_get_include_dir(/* const config_t * */ C) \
+ ((C)->include_dir)
+
+#define /* void */ config_set_auto_convert(/* config_t * */ C, F) \
+ config_set_option((C), CONFIG_OPTION_AUTOCONVERT, (F))
+#define /* int */ config_get_auto_convert(/* const config_t * */ C) \
+ config_get_option((C), CONFIG_OPTION_AUTOCONVERT)
+
+#define /* int */ config_setting_type(/* const config_setting_t * */ S) \
+ ((S)->type)
+
+#define /* int */ config_setting_is_group(/* const config_setting_t * */ S) \
+ ((S)->type == CONFIG_TYPE_GROUP)
+#define /* int */ config_setting_is_array(/* const config_setting_t * */ S) \
+ ((S)->type == CONFIG_TYPE_ARRAY)
+#define /* int */ config_setting_is_list(/* const config_setting_t * */ S) \
+ ((S)->type == CONFIG_TYPE_LIST)
+
+#define /* int */ config_setting_is_number(/* const config_setting_t * */ S) \
+ (((S)->type == CONFIG_TYPE_INT) \
+ || ((S)->type == CONFIG_TYPE_INT64) \
+ || ((S)->type == CONFIG_TYPE_FLOAT))
+
+#define /* const char * */ config_setting_name( \
+ /* const config_setting_t * */ S) \
+ ((S)->name)
+
+#define /* config_setting_t * */ config_setting_parent( \
+ /* const config_setting_t * */ S) \
+ ((S)->parent)
+
+#define /* int */ config_setting_is_root( \
+ /* const config_setting_t * */ S) \
+ ((S)->parent ? CONFIG_FALSE : CONFIG_TRUE)
+
+extern LIBCONFIG_API int config_setting_index(const config_setting_t *setting);
+
+extern LIBCONFIG_API int config_setting_length(
+ const config_setting_t *setting);
+extern LIBCONFIG_API config_setting_t *config_setting_get_elem(
+ const config_setting_t *setting, unsigned int idx);
+
+extern LIBCONFIG_API config_setting_t *config_setting_get_member(
+ const config_setting_t *setting, const char *name);
+
+extern LIBCONFIG_API config_setting_t *config_setting_add(
+ config_setting_t *parent, const char *name, int type);
+extern LIBCONFIG_API int config_setting_remove(config_setting_t *parent,
+ const char *name);
+extern LIBCONFIG_API int config_setting_remove_elem(config_setting_t *parent,
+ unsigned int idx);
+extern LIBCONFIG_API void config_setting_set_hook(config_setting_t *setting,
+ void *hook);
+
+#define config_setting_get_hook(S) ((S)->hook)
+
+extern LIBCONFIG_API config_setting_t *config_lookup(const config_t *config,
+ const char *path);
+extern LIBCONFIG_API config_setting_t *config_setting_lookup(
+ config_setting_t *setting, const char *path);
+
+extern LIBCONFIG_API int config_lookup_int(const config_t *config,
+ const char *path, int *value);
+extern LIBCONFIG_API int config_lookup_int64(const config_t *config,
+ const char *path,
+ long long *value);
+extern LIBCONFIG_API int config_lookup_float(const config_t *config,
+ const char *path, double *value);
+extern LIBCONFIG_API int config_lookup_bool(const config_t *config,
+ const char *path, int *value);
+extern LIBCONFIG_API int config_lookup_string(const config_t *config,
+ const char *path,
+ const char **value);
+
+#define /* config_setting_t * */ config_root_setting( \
+ /* const config_t * */ C) \
+ ((C)->root)
+
+#define /* void */ config_set_default_format(/* config_t * */ C, \
+ /* short */ F) \
+ (C)->default_format = (F)
+
+#define /* short */ config_get_default_format(/* config_t * */ C) \
+ ((C)->default_format)
+
+#define /* unsigned short */ config_setting_source_line( \
+ /* const config_setting_t * */ S) \
+ ((S)->line)
+
+#define /* const char */ config_setting_source_file( \
+ /* const config_setting_t * */ S) \
+ ((S)->file)
+
+#define /* const char * */ config_error_text(/* const config_t * */ C) \
+ ((C)->error_text)
+
+#define /* const char * */ config_error_file(/* const config_t * */ C) \
+ ((C)->error_file)
+
+#define /* int */ config_error_line(/* const config_t * */ C) \
+ ((C)->error_line)
+
+#define /* config_error_t */ config_error_type(/* const config_t * */ C) \
+ ((C)->error_type)
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __libconfig_h */
diff --git a/lib/libconfig.h++ b/lib/libconfig.h++
new file mode 100644
index 0000000..18578fa
--- /dev/null
+++ b/lib/libconfig.h++
@@ -0,0 +1,574 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __libconfig_hpp
+#define __libconfig_hpp
+
+#include <stdio.h>
+#include <exception>
+#include <string>
+
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+#if defined(LIBCONFIGXX_STATIC)
+#define LIBCONFIGXX_API
+#elif defined(LIBCONFIGXX_EXPORTS)
+#define LIBCONFIGXX_API __declspec(dllexport)
+#else /* ! LIBCONFIGXX_EXPORTS */
+#define LIBCONFIGXX_API __declspec(dllimport)
+#endif /* LIBCONFIGXX_STATIC */
+#else /* ! WIN32 */
+#define LIBCONFIGXX_API
+#endif /* WIN32 */
+
+#define LIBCONFIGXX_VER_MAJOR 1
+#define LIBCONFIGXX_VER_MINOR 7
+#define LIBCONFIGXX_VER_REVISION 0
+
+#if __cplusplus < 201103L
+#define LIBCONFIGXX_NOEXCEPT throw()
+#else
+#define LIBCONFIGXX_NOEXCEPT noexcept
+#endif
+
+struct config_t; // fwd decl
+struct config_setting_t; // fwd decl
+
+namespace libconfig {
+
+class LIBCONFIGXX_API ConfigException : public std::exception { };
+
+class Setting; // fwd decl
+class SettingIterator;
+class SettingConstIterator;
+
+class LIBCONFIGXX_API SettingException : public ConfigException
+{
+ public:
+
+ SettingException(const Setting &setting);
+ SettingException(const Setting &setting, int idx);
+ SettingException(const Setting &setting, const char *name);
+ SettingException(const char *path);
+
+ SettingException(const SettingException &other);
+ SettingException& operator=(const SettingException &other);
+
+ virtual ~SettingException() LIBCONFIGXX_NOEXCEPT;
+
+ const char *getPath() const;
+
+ virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
+
+ private:
+
+ char *_path;
+};
+
+class LIBCONFIGXX_API SettingTypeException : public SettingException
+{
+ public:
+
+ SettingTypeException(const Setting &setting);
+ SettingTypeException(const Setting &setting, int idx);
+ SettingTypeException(const Setting &setting, const char *name);
+
+ virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
+};
+
+class LIBCONFIGXX_API SettingNotFoundException : public SettingException
+{
+ public:
+
+ SettingNotFoundException(const char *path);
+ SettingNotFoundException(const Setting &setting, int idx);
+ SettingNotFoundException(const Setting &setting, const char *name);
+
+ virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
+};
+
+class LIBCONFIGXX_API SettingNameException : public SettingException
+{
+ public:
+
+ SettingNameException(const Setting &setting, const char *name);
+
+ virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
+};
+
+class LIBCONFIGXX_API FileIOException : public ConfigException
+{
+ public:
+
+ virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
+};
+
+class LIBCONFIGXX_API ParseException : public ConfigException
+{
+ public:
+
+ ParseException(const char *file, int line, const char *error);
+
+ ParseException(const ParseException &other);
+
+ virtual ~ParseException() LIBCONFIGXX_NOEXCEPT;
+
+ inline const char *getFile() const
+ { return(_file); }
+
+ inline int getLine() const
+ { return(_line); }
+
+ inline const char *getError() const
+ { return(_error); }
+
+ virtual const char *what() const LIBCONFIGXX_NOEXCEPT;
+
+ private:
+
+ const char *_file;
+ int _line;
+ const char *_error;
+};
+
+class LIBCONFIGXX_API Setting
+{
+ friend class Config;
+
+ public:
+
+ enum Type
+ {
+ TypeNone = 0,
+ // scalar types
+ TypeInt,
+ TypeInt64,
+ TypeFloat,
+ TypeString,
+ TypeBoolean,
+ // aggregate types
+ TypeGroup,
+ TypeArray,
+ TypeList
+ };
+
+ enum Format
+ {
+ FormatDefault = 0,
+ FormatHex = 1
+ };
+
+ typedef SettingIterator iterator;
+ typedef SettingConstIterator const_iterator;
+
+ public:
+
+ virtual ~Setting();
+
+ inline Type getType() const { return(_type); }
+
+ inline Format getFormat() const { return(_format); }
+ void setFormat(Format format);
+
+ operator bool() const;
+ operator int() const;
+ operator unsigned int() const;
+ operator long() const;
+ operator unsigned long() const;
+ operator long long() const;
+ operator unsigned long long() const;
+ operator double() const;
+ operator float() const;
+ operator const char *() const;
+ operator std::string() const;
+
+ inline const char *c_str() const
+ { return operator const char *(); }
+
+ Setting & operator=(bool value);
+ Setting & operator=(int value);
+ Setting & operator=(long value);
+ Setting & operator=(const long long &value);
+ Setting & operator=(const double &value);
+ Setting & operator=(float value);
+ Setting & operator=(const char *value);
+ Setting & operator=(const std::string &value);
+
+ Setting & lookup(const char *path) const;
+ inline Setting & lookup(const std::string &path) const
+ { return(lookup(path.c_str())); }
+
+ Setting & operator[](const char *name) const;
+
+ inline Setting & operator[](const std::string &name) const
+ { return(operator[](name.c_str())); }
+
+ Setting & operator[](int index) const;
+
+ bool lookupValue(const char *name, bool &value) const;
+ bool lookupValue(const char *name, int &value) const;
+ bool lookupValue(const char *name, unsigned int &value) const;
+ bool lookupValue(const char *name, long long &value) const;
+ bool lookupValue(const char *name, unsigned long long &value) const;
+ bool lookupValue(const char *name, double &value) const;
+ bool lookupValue(const char *name, float &value) const;
+ bool lookupValue(const char *name, const char *&value) const;
+ bool lookupValue(const char *name, std::string &value) const;
+
+ inline bool lookupValue(const std::string &name, bool &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, int &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, unsigned int &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, long long &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name,
+ unsigned long long &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, double &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, float &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, const char *&value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &name, std::string &value) const
+ { return(lookupValue(name.c_str(), value)); }
+
+ void remove(const char *name);
+
+ inline void remove(const std::string &name)
+ { remove(name.c_str()); }
+
+ void remove(unsigned int idx);
+
+ Setting & add(const char *name, Type type);
+
+ inline Setting & add(const std::string &name, Type type)
+ { return(add(name.c_str(), type)); }
+
+ Setting & add(Type type);
+
+ bool exists(const char *name) const;
+
+ inline bool exists(const std::string &name) const
+ { return(exists(name.c_str())); }
+
+ int getLength() const;
+ const char *getName() const;
+ std::string getPath() const;
+ int getIndex() const;
+
+ const Setting & getParent() const;
+ Setting & getParent();
+
+ bool isRoot() const;
+
+ inline bool isGroup() const
+ { return(_type == TypeGroup); }
+
+ inline bool isArray() const
+ { return(_type == TypeArray); }
+
+ inline bool isList() const
+ { return(_type == TypeList); }
+
+ inline bool isAggregate() const
+ { return(_type >= TypeGroup); }
+
+ inline bool isScalar() const
+ { return((_type > TypeNone) && (_type < TypeGroup)); }
+
+ inline bool isNumber() const
+ {
+ return((_type == TypeInt) || (_type == TypeInt64) || (_type == TypeFloat));
+ }
+
+ inline bool isString() const
+ { return(_type == TypeString); }
+
+ unsigned int getSourceLine() const;
+ const char *getSourceFile() const;
+
+ iterator begin();
+ iterator end();
+
+ const_iterator begin() const;
+ const_iterator end() const;
+
+ private:
+
+ config_setting_t *_setting;
+ Type _type;
+ Format _format;
+
+ Setting(config_setting_t *setting);
+
+ void assertType(Type type) const;
+ static Setting & wrapSetting(config_setting_t *setting);
+
+ Setting(const Setting& other); // not supported
+ Setting& operator=(const Setting& other); // not supported
+};
+
+
+class LIBCONFIGXX_API SettingIterator
+{
+ public:
+
+ SettingIterator(Setting &setting, bool endIterator = false);
+ SettingIterator(const SettingIterator &other);
+ SettingIterator& operator=(const SettingIterator &other);
+
+ // Equality comparison.
+ inline bool operator==(SettingIterator const &other) const
+ { return((_setting == other._setting) && (_idx == other._idx)); }
+
+ inline bool operator!=(SettingIterator const &other) const
+ { return(!operator==(other)); }
+
+ bool operator<(SettingIterator const &other) const;
+
+ // Dereference operators.
+ inline Setting & operator*()
+ { return((*_setting)[_idx]); }
+
+ inline Setting * operator->()
+ { return(&(*_setting)[_idx]); }
+
+ inline const Setting & operator*() const
+ { return(*_setting)[_idx]; }
+ inline const Setting * operator->() const
+ { return(&(*_setting)[_idx]); }
+
+ // Increment and decrement operators.
+ SettingIterator & operator++();
+ SettingIterator operator++(int);
+
+ SettingIterator & operator--();
+ SettingIterator operator--(int);
+
+ // Arithmetic operators.
+ SettingIterator operator+(int offset) const;
+ SettingIterator & operator+=(int offset);
+
+ SettingIterator operator-(int offset) const;
+ SettingIterator & operator-=(int offset);
+
+ int operator-(const SettingIterator &other) const;
+
+ private:
+
+ Setting *_setting;
+
+ int _count;
+ int _idx;
+};
+
+SettingIterator operator+(int offset, const SettingIterator &si);
+
+class LIBCONFIGXX_API SettingConstIterator
+{
+ public:
+
+ SettingConstIterator(const Setting &setting, bool endIterator = false);
+ SettingConstIterator(const SettingConstIterator &rhs);
+ SettingConstIterator& operator=(const SettingConstIterator &rhs);
+
+ // Equality comparison.
+ bool operator==(SettingConstIterator const &other) const
+ { return((_setting == other._setting) && (_idx == other._idx)); }
+
+ inline bool operator!=(SettingConstIterator const &other) const
+ { return(!operator==(other)); }
+
+ // Dereference operators.
+ inline Setting const & operator*()
+ { return((*_setting)[_idx]); }
+ inline Setting const * operator->()
+ { return(&(*_setting)[_idx]); }
+
+ inline const Setting& operator*() const
+ { return((*_setting)[_idx]); }
+ inline const Setting * operator->() const
+ { return(&(*_setting)[_idx]); }
+
+ // Increment and decrement operators.
+ SettingConstIterator & operator++();
+ SettingConstIterator operator++(int);
+
+ SettingConstIterator & operator--();
+ SettingConstIterator operator--(int);
+
+ // Arithmetic operators.
+ SettingConstIterator operator+(int offset) const;
+ SettingConstIterator & operator+=(int offset);
+
+ SettingConstIterator operator-(int offset) const;
+ SettingConstIterator & operator-=(int offset);
+
+ int operator-(const SettingConstIterator &other) const;
+
+ private:
+
+ const Setting *_setting;
+
+ int _count;
+ int _idx;
+};
+
+SettingConstIterator operator+(int offset, const SettingConstIterator &si);
+
+class LIBCONFIGXX_API Config
+{
+ public:
+
+ enum Option
+ {
+ OptionNone = 0,
+ OptionAutoConvert = 0x01,
+ OptionSemicolonSeparators = 0x02,
+ OptionColonAssignmentForGroups = 0x04,
+ OptionColonAssignmentForNonGroups = 0x08,
+ OptionOpenBraceOnSeparateLine = 0x10,
+ OptionAllowScientificNotation = 0x20,
+ OptionFsync = 0x40,
+ OptionAllowOverrides = 0x80
+ };
+
+ Config();
+ virtual ~Config();
+
+ void clear();
+
+ void setOptions(int options);
+ int getOptions() const;
+
+ void setOption(Config::Option option, bool flag);
+ bool getOption(Config::Option option) const;
+
+ inline void setAutoConvert(bool flag)
+ { setOption(Config::OptionAutoConvert, flag); }
+ inline bool getAutoConvert() const
+ { return(getOption(Config::OptionAutoConvert)); }
+
+ void setDefaultFormat(Setting::Format format);
+ inline Setting::Format getDefaultFormat() const
+ { return(_defaultFormat); }
+
+ void setTabWidth(unsigned short width);
+ unsigned short getTabWidth() const;
+
+ void setFloatPrecision(unsigned short digits);
+ unsigned short getFloatPrecision() const;
+
+ void setIncludeDir(const char *includeDir);
+ const char *getIncludeDir() const;
+
+ virtual const char **evaluateIncludePath(const char *path,
+ const char **error);
+
+ void read(FILE *stream);
+ void write(FILE *stream) const;
+
+ void readString(const char *str);
+ inline void readString(const std::string &str)
+ { return(readString(str.c_str())); }
+
+ void readFile(const char *filename);
+ inline void readFile(const std::string &filename)
+ { readFile(filename.c_str()); }
+
+ void writeFile(const char *filename);
+ inline void writeFile(const std::string &filename)
+ { writeFile(filename.c_str()); }
+
+ Setting & lookup(const char *path) const;
+ inline Setting & lookup(const std::string &path) const
+ { return(lookup(path.c_str())); }
+
+ bool exists(const char *path) const;
+ inline bool exists(const std::string &path) const
+ { return(exists(path.c_str())); }
+
+ bool lookupValue(const char *path, bool &value) const;
+ bool lookupValue(const char *path, int &value) const;
+ bool lookupValue(const char *path, unsigned int &value) const;
+ bool lookupValue(const char *path, long long &value) const;
+ bool lookupValue(const char *path, unsigned long long &value) const;
+ bool lookupValue(const char *path, double &value) const;
+ bool lookupValue(const char *path, float &value) const;
+ bool lookupValue(const char *path, const char *&value) const;
+ bool lookupValue(const char *path, std::string &value) const;
+
+ inline bool lookupValue(const std::string &path, bool &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, int &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, unsigned int &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, long long &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path,
+ unsigned long long &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, double &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, float &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, const char *&value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ inline bool lookupValue(const std::string &path, std::string &value) const
+ { return(lookupValue(path.c_str(), value)); }
+
+ Setting & getRoot() const;
+
+ private:
+
+ static void ConfigDestructor(void *arg);
+ void handleError() const;
+
+ config_t *_config;
+ Setting::Format _defaultFormat;
+
+ Config(const Config& other); // not supported
+ Config& operator=(const Config& other); // not supported
+};
+
+} // namespace libconfig
+
+#endif // __libconfig_hpp
diff --git a/lib/libconfig.hh b/lib/libconfig.hh
new file mode 100644
index 0000000..a3257d0
--- /dev/null
+++ b/lib/libconfig.hh
@@ -0,0 +1,23 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A structured configuration file parsing library
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ----------------------------------------------------------------------------
+*/
+
+#include <libconfig.h++>
diff --git a/lib/libconfig.pc.in b/lib/libconfig.pc.in
new file mode 100644
index 0000000..4f7628b
--- /dev/null
+++ b/lib/libconfig.pc.in
@@ -0,0 +1,14 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libconfig
+Description: C Configuration File Library
+Version: @VERSION@
+URL: http://www.hyperrealm.com/main.php?s=libconfig
+Requires:
+Conflicts:
+Libs: -L${libdir} -lconfig
+Libs.private: @LIBS@
+Cflags: -I${includedir}
diff --git a/lib/libconfig.vcproj b/lib/libconfig.vcproj
new file mode 100644
index 0000000..6b8bd21
--- /dev/null
+++ b/lib/libconfig.vcproj
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libconfig"
+ ProjectGUID="{1A234565-926D-49B2-83E4-D56E0C38C9F2}"
+ RootNamespace="libconfig"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL"
+ RuntimeLibrary="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Shlwapi.lib"
+ OutputFile="$(OutDir)\$(ProjectName)_d.dll"
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ MapExports="true"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H"
+ RuntimeLibrary="2"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Shlwapi.lib"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\grammar.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libconfig.c"
+ >
+ </File>
+ <File
+ RelativePath=".\scanctx.c"
+ >
+ </File>
+ <File
+ RelativePath=".\scanner.c"
+ >
+ </File>
+ <File
+ RelativePath=".\strbuf.c"
+ >
+ </File>
+ <File
+ RelativePath=".\strvec.c"
+ >
+ </File>
+ <File
+ RelativePath=".\util.c"
+ >
+ </File>
+ <File
+ RelativePath=".\wincompat.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\ac_config.h"
+ >
+ </File>
+ <File
+ RelativePath=".\grammar.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libconfig.h"
+ >
+ </File>
+ <File
+ RelativePath=".\parsectx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\private.h"
+ >
+ </File>
+ <File
+ RelativePath=".\scanctx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\scanner.h"
+ >
+ </File>
+ <File
+ RelativePath=".\win32\stdint.h"
+ >
+ </File>
+ <File
+ RelativePath=".\strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath=".\strvec.h"
+ >
+ </File>
+ <File
+ RelativePath=".\util.h"
+ >
+ </File>
+ <File
+ RelativePath=".\wincompat.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/lib/libconfig.vcxproj b/lib/libconfig.vcxproj
new file mode 100644
index 0000000..5b34d21
--- /dev/null
+++ b/lib/libconfig.vcxproj
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{1A234565-926D-49B2-83E4-D56E0C38C9F2}</ProjectGuid>
+ <RootNamespace>libconfig</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>$(ProjectName)d</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName)_d.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName)_d.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>LIBCONFIG_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>WIN64;LIBCONFIG_STATIC;YY_NO_UNISTD_H;YY_USE_CONST;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_STDLIB_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="grammar.c" />
+ <ClCompile Include="libconfig.c" />
+ <ClCompile Include="scanctx.c" />
+ <ClCompile Include="scanner.c" />
+ <ClCompile Include="strbuf.c" />
+ <ClCompile Include="strvec.c" />
+ <ClCompile Include="util.c" />
+ <ClCompile Include="wincompat.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\ac_config.h" />
+ <ClInclude Include="grammar.h" />
+ <ClInclude Include="libconfig.h" />
+ <ClInclude Include="parsectx.h" />
+ <ClInclude Include="private.h" />
+ <ClInclude Include="scanctx.h" />
+ <ClInclude Include="scanner.h" />
+ <ClInclude Include="strbuf.h" />
+ <ClInclude Include="strvec.h" />
+ <ClInclude Include="util.h" />
+ <ClInclude Include="win32\stdint.h" />
+ <ClInclude Include="wincompat.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/lib/libconfig.vcxproj.filters b/lib/libconfig.vcxproj.filters
new file mode 100644
index 0000000..41c7bbc
--- /dev/null
+++ b/lib/libconfig.vcxproj.filters
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="grammar.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="libconfig.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="scanctx.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="scanner.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="strbuf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="strvec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="util.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\ac_config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="grammar.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="libconfig.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="parsectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="private.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="scanctx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="scanner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="win32\stdint.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="strbuf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="strvec.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="util.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="wincompat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/lib/libconfigConfig.cmake.in b/lib/libconfigConfig.cmake.in
new file mode 100644
index 0000000..57868f8
--- /dev/null
+++ b/lib/libconfigConfig.cmake.in
@@ -0,0 +1,7 @@
+set(LIBCONFIG_FOUND 1)
+set(LIBCONFIG_VERSION "1.7")
+set(LIBCONFIG_LIBRARIES "config")
+set(LIBCONFIG_LIBRARY_DIRS "@libdir@")
+set(LIBCONFIG_LDFLAGS "")
+set(LIBCONFIG_INCLUDE_DIRS "@includedir@")
+set(LIBCONFIG_CFLAGS "")
diff --git a/lib/libconfigcpp.c++ b/lib/libconfigcpp.c++
new file mode 100644
index 0000000..9cdee4d
--- /dev/null
+++ b/lib/libconfigcpp.c++
@@ -0,0 +1,1487 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "libconfig.h++"
+
+#ifdef _MSC_VER
+#pragma warning (disable: 4996)
+#endif
+
+#include "wincompat.h"
+#include "libconfig.h"
+
+#include <cstring>
+#include <cstdlib>
+#include <sstream>
+
+namespace libconfig {
+
+// ---------------------------------------------------------------------------
+
+static const char **__include_func(config_t *config,
+ const char *include_dir,
+ const char *path,
+ const char **error)
+{
+ Config *self = reinterpret_cast<Config *>(config_get_hook(config));
+ return(self->evaluateIncludePath(path, error));
+}
+
+// ---------------------------------------------------------------------------
+
+ParseException::ParseException(const char *file, int line, const char *error)
+ : _file(file ? ::strdup(file) : NULL), _line(line), _error(error)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+ParseException::ParseException(const ParseException &other)
+ : ConfigException(other),
+ _file(other._file ? ::strdup(other._file) : NULL),
+ _line(other._line),
+ _error(other._error)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+ParseException::~ParseException() LIBCONFIGXX_NOEXCEPT
+{
+ ::free((void *)_file);
+}
+
+// ---------------------------------------------------------------------------
+
+const char *ParseException::what() const LIBCONFIGXX_NOEXCEPT
+{
+ return("ParseException");
+}
+
+// ---------------------------------------------------------------------------
+
+static int __toTypeCode(Setting::Type type)
+{
+ int typecode;
+
+ switch(type)
+ {
+ case Setting::TypeGroup:
+ typecode = CONFIG_TYPE_GROUP;
+ break;
+
+ case Setting::TypeInt:
+ typecode = CONFIG_TYPE_INT;
+ break;
+
+ case Setting::TypeInt64:
+ typecode = CONFIG_TYPE_INT64;
+ break;
+
+ case Setting::TypeFloat:
+ typecode = CONFIG_TYPE_FLOAT;
+ break;
+
+ case Setting::TypeString:
+ typecode = CONFIG_TYPE_STRING;
+ break;
+
+ case Setting::TypeBoolean:
+ typecode = CONFIG_TYPE_BOOL;
+ break;
+
+ case Setting::TypeArray:
+ typecode = CONFIG_TYPE_ARRAY;
+ break;
+
+ case Setting::TypeList:
+ typecode = CONFIG_TYPE_LIST;
+ break;
+
+ default:
+ typecode = CONFIG_TYPE_NONE;
+ }
+
+ return(typecode);
+}
+
+// ---------------------------------------------------------------------------
+
+static void __constructPath(const Setting &setting,
+ std::stringstream &path)
+{
+ // head recursion to print path from root to target
+
+ if(! setting.isRoot())
+ {
+ __constructPath(setting.getParent(), path);
+ if(path.tellp() > 0)
+ path << '.';
+
+ const char *name = setting.getName();
+ if(name)
+ path << name;
+ else
+ path << '[' << setting.getIndex() << ']';
+ }
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException::SettingException(const Setting &setting)
+{
+ std::stringstream sstr;
+ __constructPath(setting, sstr);
+
+ _path = ::strdup(sstr.str().c_str());
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException::SettingException(const Setting &setting, int idx)
+{
+ std::stringstream sstr;
+ __constructPath(setting, sstr);
+ sstr << ".[" << idx << "]";
+
+ _path = ::strdup(sstr.str().c_str());
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException::SettingException(const Setting &setting, const char *name)
+{
+ std::stringstream sstr;
+ __constructPath(setting, sstr);
+ sstr << '.' << name;
+
+ _path = ::strdup(sstr.str().c_str());
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException::SettingException(const char *path)
+{
+ _path = ::strdup(path);
+}
+
+// ---------------------------------------------------------------------------
+
+const char *SettingException::getPath() const
+{
+ return(_path);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException::SettingException(const SettingException &other)
+ : ConfigException(other)
+{
+ _path = ::strdup(other._path);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException &SettingException::operator=(const SettingException &other)
+{
+ ::free(_path);
+ _path = ::strdup(other._path);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+const char *SettingException::what() const LIBCONFIGXX_NOEXCEPT
+{
+ return("SettingException");
+}
+
+// ---------------------------------------------------------------------------
+
+SettingException::~SettingException() LIBCONFIGXX_NOEXCEPT
+{
+ ::free(_path);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingTypeException::SettingTypeException(const Setting &setting)
+ : SettingException(setting)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+SettingTypeException::SettingTypeException(const Setting &setting, int idx)
+ : SettingException(setting, idx)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+SettingTypeException::SettingTypeException(const Setting &setting,
+ const char *name)
+ : SettingException(setting, name)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+const char *SettingTypeException::what() const LIBCONFIGXX_NOEXCEPT
+{
+ return("SettingTypeException");
+}
+
+// ---------------------------------------------------------------------------
+
+SettingNotFoundException::SettingNotFoundException(const Setting &setting,
+ int idx)
+ : SettingException(setting, idx)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+SettingNotFoundException::SettingNotFoundException(const Setting &setting,
+ const char *name)
+ : SettingException(setting, name)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+SettingNotFoundException::SettingNotFoundException(const char *path)
+ : SettingException(path)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+const char *SettingNotFoundException::what() const LIBCONFIGXX_NOEXCEPT
+{
+ return("SettingNotFoundException");
+}
+
+// ---------------------------------------------------------------------------
+
+SettingNameException::SettingNameException(const Setting &setting,
+ const char *name)
+ : SettingException(setting, name)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+const char *SettingNameException::what() const LIBCONFIGXX_NOEXCEPT
+{
+ return("SettingNameException");
+}
+
+// ---------------------------------------------------------------------------
+
+const char *FileIOException::what() const LIBCONFIGXX_NOEXCEPT
+{
+ return("FileIOException");
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::ConfigDestructor(void *arg)
+{
+ delete reinterpret_cast<Setting *>(arg);
+}
+
+// ---------------------------------------------------------------------------
+
+Config::Config()
+ : _defaultFormat(Setting::FormatDefault)
+{
+ _config = new config_t;
+ config_init(_config);
+ config_set_hook(_config, reinterpret_cast<void *>(this));
+ config_set_destructor(_config, ConfigDestructor);
+ config_set_include_func(_config, __include_func);
+}
+
+// ---------------------------------------------------------------------------
+
+Config::~Config()
+{
+ config_destroy(_config);
+ delete _config;
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::clear()
+{
+ config_clear(_config);
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::setOptions(int options)
+{
+ config_set_options(_config, options);
+}
+
+// ---------------------------------------------------------------------------
+
+int Config::getOptions() const
+{
+ return(config_get_options(_config));
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::setOption(Config::Option option, bool flag)
+{
+ config_set_option(_config, (int)option, flag ? CONFIG_TRUE : CONFIG_FALSE);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::getOption(Config::Option option) const
+{
+ return(config_get_option(_config, (int)option) == CONFIG_TRUE);
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::setDefaultFormat(Setting::Format format)
+{
+ if(format == Setting::FormatHex)
+ _defaultFormat = Setting::FormatHex;
+ else
+ _defaultFormat = Setting::FormatDefault;
+
+ config_set_default_format(_config, static_cast<short>(_defaultFormat));
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::setTabWidth(unsigned short width)
+{
+ config_set_tab_width(_config, width);
+}
+
+// ---------------------------------------------------------------------------
+
+unsigned short Config::getTabWidth() const
+{
+ return(config_get_tab_width(_config));
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::setFloatPrecision(unsigned short digits)
+{
+ return (config_set_float_precision(_config,digits));
+}
+
+// ---------------------------------------------------------------------------
+
+unsigned short Config::getFloatPrecision() const
+{
+ return (config_get_float_precision(_config));
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::setIncludeDir(const char *includeDir)
+{
+ config_set_include_dir(_config, includeDir);
+}
+
+// ---------------------------------------------------------------------------
+
+const char *Config::getIncludeDir() const
+{
+ return(config_get_include_dir(_config));
+}
+
+// ---------------------------------------------------------------------------
+
+const char **Config::evaluateIncludePath(const char *path, const char **error)
+{
+ return(config_default_include_func(_config, getIncludeDir(), path, error));
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::handleError() const
+{
+ switch(config_error_type(_config))
+ {
+ case CONFIG_ERR_NONE:
+ break;
+
+ case CONFIG_ERR_PARSE:
+ throw ParseException(config_error_file(_config),
+ config_error_line(_config),
+ config_error_text(_config));
+ break;
+
+ case CONFIG_ERR_FILE_IO:
+ default:
+ throw FileIOException();
+ }
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::read(FILE *stream)
+{
+ if(! config_read(_config, stream))
+ handleError();
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::readString(const char *str)
+{
+ if(! config_read_string(_config, str))
+ handleError();
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::write(FILE *stream) const
+{
+ config_write(_config, stream);
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::readFile(const char *filename)
+{
+ if(! config_read_file(_config, filename))
+ handleError();
+}
+
+// ---------------------------------------------------------------------------
+
+void Config::writeFile(const char *filename)
+{
+ if(! config_write_file(_config, filename))
+ handleError();
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Config::lookup(const char *path) const
+{
+ config_setting_t *s = config_lookup(_config, path);
+ if(! s)
+ throw SettingNotFoundException(path);
+
+ return(Setting::wrapSetting(s));
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::exists(const char *path) const
+{
+ config_setting_t *s = config_lookup(_config, path);
+
+ return(s != NULL);
+}
+
+// ---------------------------------------------------------------------------
+
+#define CONFIG_LOOKUP_NO_EXCEPTIONS(P, T, V) \
+ try \
+ { \
+ Setting &s = lookup(P); \
+ V = (T)s; \
+ return(true); \
+ } \
+ catch(const ConfigException &) \
+ { \
+ return(false); \
+ }
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, bool &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, bool, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, int &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, int, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, unsigned int &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, unsigned int, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, long long &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, long long, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, unsigned long long &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, unsigned long long, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, double &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, double, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, float &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, float, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, const char *&value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, const char *, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Config::lookupValue(const char *path, std::string &value) const
+{
+ CONFIG_LOOKUP_NO_EXCEPTIONS(path, const char *, value);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Config::getRoot() const
+{
+ return(Setting::wrapSetting(config_root_setting(_config)));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::Setting(config_setting_t *setting)
+ : _setting(setting)
+{
+ switch(config_setting_type(setting))
+ {
+ case CONFIG_TYPE_GROUP:
+ _type = TypeGroup;
+ break;
+
+ case CONFIG_TYPE_INT:
+ _type = TypeInt;
+ break;
+
+ case CONFIG_TYPE_INT64:
+ _type = TypeInt64;
+ break;
+
+ case CONFIG_TYPE_FLOAT:
+ _type = TypeFloat;
+ break;
+
+ case CONFIG_TYPE_STRING:
+ _type = TypeString;
+ break;
+
+ case CONFIG_TYPE_BOOL:
+ _type = TypeBoolean;
+ break;
+
+ case CONFIG_TYPE_ARRAY:
+ _type = TypeArray;
+ break;
+
+ case CONFIG_TYPE_LIST:
+ _type = TypeList;
+ break;
+
+ case CONFIG_TYPE_NONE:
+ default:
+ _type = TypeNone;
+ break;
+ }
+
+ switch(config_setting_get_format(setting))
+ {
+ case CONFIG_FORMAT_HEX:
+ _format = FormatHex;
+ break;
+
+ case CONFIG_FORMAT_DEFAULT:
+ default:
+ _format = FormatDefault;
+ break;
+ }
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::~Setting()
+{
+ _setting = NULL;
+}
+
+// ---------------------------------------------------------------------------
+
+void Setting::setFormat(Format format)
+{
+ if((_type == TypeInt) || (_type == TypeInt64))
+ {
+ if(format == FormatHex)
+ _format = FormatHex;
+ else
+ _format = FormatDefault;
+ }
+ else
+ _format = FormatDefault;
+
+ config_setting_set_format(_setting, static_cast<short>(_format));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator bool() const
+{
+ assertType(TypeBoolean);
+
+ return(config_setting_get_bool(_setting) ? true : false);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator int() const
+{
+ assertType(TypeInt);
+
+ return(config_setting_get_int(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator unsigned int() const
+{
+ assertType(TypeInt);
+
+ int v = config_setting_get_int(_setting);
+
+ return(static_cast<unsigned int>(v));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator long() const
+{
+ if(sizeof(long) == sizeof(long long))
+ return operator long long();
+ else
+ return operator int();
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator unsigned long() const
+{
+ if(sizeof(long) == sizeof(long long))
+ return operator unsigned long long();
+ else
+ return operator unsigned int();
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator long long() const
+{
+ assertType(TypeInt64);
+
+ return(config_setting_get_int64(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator unsigned long long() const
+{
+ assertType(TypeInt64);
+
+ long long v = config_setting_get_int64(_setting);
+
+ return(static_cast<unsigned long long>(v));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator double() const
+{
+ assertType(TypeFloat);
+
+ return(config_setting_get_float(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator float() const
+{
+ assertType(TypeFloat);
+
+ // may cause loss of precision:
+ return(static_cast<float>(config_setting_get_float(_setting)));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator const char *() const
+{
+ assertType(TypeString);
+
+ return(config_setting_get_string(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::operator std::string() const
+{
+ assertType(TypeString);
+
+ const char *s = config_setting_get_string(_setting);
+
+ std::string str;
+ if(s)
+ str = s;
+
+ return(str);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(bool value)
+{
+ assertType(TypeBoolean);
+
+ config_setting_set_bool(_setting, value);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(int value)
+{
+ assertType(TypeInt);
+
+ config_setting_set_int(_setting, value);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(long value)
+{
+ if(sizeof(long) == sizeof(long long))
+ return(operator=(static_cast<long long>(value)));
+ else
+ return(operator=(static_cast<int>(value)));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(const long long &value)
+{
+ assertType(TypeInt64);
+
+ config_setting_set_int64(_setting, value);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(const double &value)
+{
+ assertType(TypeFloat);
+
+ config_setting_set_float(_setting, value);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(float value)
+{
+ assertType(TypeFloat);
+
+ double cvalue = static_cast<double>(value);
+
+ config_setting_set_float(_setting, cvalue);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(const char *value)
+{
+ assertType(TypeString);
+
+ config_setting_set_string(_setting, value);
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator=(const std::string &value)
+{
+ assertType(TypeString);
+
+ config_setting_set_string(_setting, value.c_str());
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::lookup(const char *path) const
+{
+ assertType(TypeGroup);
+
+ config_setting_t *setting = config_setting_lookup(_setting, path);
+
+ if(! setting)
+ throw SettingNotFoundException(*this, path);
+
+ return(wrapSetting(setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator[](const char *name) const
+{
+ assertType(TypeGroup);
+
+ config_setting_t *setting = config_setting_get_member(_setting, name);
+
+ if(! setting)
+ throw SettingNotFoundException(*this, name);
+
+ return(wrapSetting(setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::operator[](int i) const
+{
+ if((_type != TypeArray) && (_type != TypeGroup) && (_type != TypeList))
+ throw SettingTypeException(*this, i);
+
+ config_setting_t *setting = config_setting_get_elem(_setting, i);
+
+ if(! setting)
+ throw SettingNotFoundException(*this, i);
+
+ return(wrapSetting(setting));
+}
+
+// ---------------------------------------------------------------------------
+
+#define SETTING_LOOKUP_NO_EXCEPTIONS(K, T, V) \
+ try \
+ { \
+ Setting &s = operator[](K); \
+ V = (T)s; \
+ return(true); \
+ } \
+ catch(const ConfigException &) \
+ { \
+ return(false); \
+ }
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, bool &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, bool, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, int &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, int, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, unsigned int &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, unsigned int, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, long long &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, long long, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, unsigned long long &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, unsigned long long, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, double &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, double, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, float &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, float, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, const char *&value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, const char *, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::lookupValue(const char *name, std::string &value) const
+{
+ SETTING_LOOKUP_NO_EXCEPTIONS(name, const char *, value);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::exists(const char *name) const
+{
+ if(_type != TypeGroup)
+ return(false);
+
+ config_setting_t *setting = config_setting_get_member(_setting, name);
+
+ return(setting != NULL);
+}
+
+// ---------------------------------------------------------------------------
+
+int Setting::getLength() const
+{
+ return(config_setting_length(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+const char * Setting::getName() const
+{
+ return(config_setting_name(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+std::string Setting::getPath() const
+{
+ std::stringstream path;
+
+ __constructPath(*this, path);
+
+ return(path.str());
+}
+
+// ---------------------------------------------------------------------------
+
+const Setting & Setting::getParent() const
+{
+ config_setting_t *setting = config_setting_parent(_setting);
+
+ if(! setting)
+ throw SettingNotFoundException(NULL);
+
+ return(wrapSetting(setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::getParent()
+{
+ config_setting_t *setting = config_setting_parent(_setting);
+
+ if(! setting)
+ throw SettingNotFoundException(NULL);
+
+ return(wrapSetting(setting));
+}
+
+// ---------------------------------------------------------------------------
+
+unsigned int Setting::getSourceLine() const
+{
+ return(config_setting_source_line(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+const char *Setting::getSourceFile() const
+{
+ return(config_setting_source_file(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+bool Setting::isRoot() const
+{
+ return(config_setting_is_root(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+int Setting::getIndex() const
+{
+ return(config_setting_index(_setting));
+}
+
+// ---------------------------------------------------------------------------
+
+void Setting::remove(const char *name)
+{
+ assertType(TypeGroup);
+
+ if(! config_setting_remove(_setting, name))
+ throw SettingNotFoundException(*this, name);
+}
+
+// ---------------------------------------------------------------------------
+
+void Setting::remove(unsigned int idx)
+{
+ if((_type != TypeArray) && (_type != TypeGroup) && (_type != TypeList))
+ throw SettingTypeException(*this, idx);
+
+ if(! config_setting_remove_elem(_setting, idx))
+ throw SettingNotFoundException(*this, idx);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::add(const char *name, Setting::Type type)
+{
+ assertType(TypeGroup);
+
+ int typecode = __toTypeCode(type);
+
+ if(typecode == CONFIG_TYPE_NONE)
+ throw SettingTypeException(*this, name);
+
+ config_setting_t *setting = config_setting_add(_setting, name, typecode);
+
+ if(! setting)
+ throw SettingNameException(*this, name);
+
+ return(wrapSetting(setting));
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::add(Setting::Type type)
+{
+ if((_type != TypeArray) && (_type != TypeList))
+ throw SettingTypeException(*this);
+
+ if(_type == TypeArray)
+ {
+ int idx = getLength();
+
+ if(idx > 0)
+ {
+ Setting::Type atype = operator[](0).getType();
+ if(type != atype)
+ throw SettingTypeException(*this, idx);
+ }
+ else
+ {
+ if((type != TypeInt) && (type != TypeInt64) && (type != TypeFloat)
+ && (type != TypeString) && (type != TypeBoolean))
+ throw SettingTypeException(*this, idx);
+ }
+ }
+
+ int typecode = __toTypeCode(type);
+ config_setting_t *s = config_setting_add(_setting, NULL, typecode);
+
+ Setting &ns = wrapSetting(s);
+
+ switch(type)
+ {
+ case TypeInt:
+ ns = 0;
+ break;
+
+ case TypeInt64:
+ ns = INT64_CONST(0);
+ break;
+
+ case TypeFloat:
+ ns = 0.0;
+ break;
+
+ case TypeString:
+ ns = (char *)NULL;
+ break;
+
+ case TypeBoolean:
+ ns = false;
+ break;
+
+ default:
+ // won't happen
+ break;
+ }
+
+ return(ns);
+}
+
+// ---------------------------------------------------------------------------
+
+void Setting::assertType(Setting::Type type) const
+{
+ if(type != _type)
+ {
+ if(!(isNumber() && config_get_auto_convert(_setting->config)
+ && ((type == TypeInt) || (type == TypeInt64) || (type == TypeFloat))))
+ throw SettingTypeException(*this);
+ }
+}
+
+// ---------------------------------------------------------------------------
+
+Setting & Setting::wrapSetting(config_setting_t *s)
+{
+ Setting *setting = NULL;
+
+ void *hook = config_setting_get_hook(s);
+ if(! hook)
+ {
+ setting = new Setting(s);
+ config_setting_set_hook(s, reinterpret_cast<void *>(setting));
+ }
+ else
+ setting = reinterpret_cast<Setting *>(hook);
+
+ return(*setting);
+}
+
+// ---------------------------------------------------------------------------
+
+Setting::iterator Setting::begin()
+{ return(iterator(*this)); }
+
+// ---------------------------------------------------------------------------
+
+Setting::iterator Setting::end()
+{ return(iterator(*this, true)); }
+
+// ---------------------------------------------------------------------------
+
+Setting::const_iterator Setting::begin() const
+{ return(const_iterator(*this)); }
+
+// ---------------------------------------------------------------------------
+
+Setting::const_iterator Setting::end() const
+{ return(const_iterator(*this, true)); }
+
+// ---------------------------------------------------------------------------
+
+SettingIterator::SettingIterator(Setting& setting, bool endIterator)
+ : _setting(&setting),
+ _count(setting.getLength()),
+ _idx(endIterator ? _count : 0)
+{
+ if(!setting.isAggregate())
+ throw SettingTypeException(setting);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator::SettingIterator(const SettingIterator &other)
+ : _setting(other._setting),
+ _count(other._count),
+ _idx(other._idx)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator& SettingIterator::operator=(const SettingIterator &other)
+{
+ _setting = other._setting;
+ _count = other._count;
+ _idx = other._idx;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator& SettingIterator::operator++()
+{
+ ++_idx;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator SettingIterator::operator++(int)
+{
+ SettingIterator tmp(*this);
+ ++_idx;
+
+ return(tmp);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator& SettingIterator::operator--()
+{
+ --_idx;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator SettingIterator::operator--(int)
+{
+ SettingIterator tmp(*this);
+ --_idx;
+
+ return(tmp);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator SettingIterator::operator+(int offset) const
+{
+ SettingIterator copy(*this);
+ copy += offset;
+
+ return(copy);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator& SettingIterator::operator+=(int offset)
+{
+ _idx += offset;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator operator+(int offset, SettingIterator& si)
+{
+ SettingIterator copy(si);
+ copy += offset;
+
+ return(copy);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator SettingIterator::operator-(int offset) const
+{
+ SettingIterator copy(*this);
+ copy._idx -= offset;
+
+ return(copy);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingIterator& SettingIterator::operator-=(int offset)
+{
+ _idx -= offset;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+int SettingIterator::operator-(SettingIterator const &other) const
+{
+ return(_idx - other._idx);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator::SettingConstIterator(const Setting &setting,
+ bool endIterator)
+ : _setting(&setting),
+ _count(setting.getLength()),
+ _idx(endIterator ? _count : 0)
+{
+ if(!setting.isAggregate())
+ throw SettingTypeException(setting);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator::SettingConstIterator(const SettingConstIterator &other)
+ : _setting(other._setting),
+ _count(other._count),
+ _idx(other._idx)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator& SettingConstIterator::operator=(
+ const SettingConstIterator &other)
+{
+ _setting = other._setting;
+ _count = other._count;
+ _idx = other._idx;
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator& SettingConstIterator::operator++()
+{
+ ++_idx;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator SettingConstIterator::operator++(int)
+{
+ SettingConstIterator tmp(*this);
+ ++_idx;
+
+ return(tmp);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator& SettingConstIterator::operator--()
+{
+ --_idx;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator SettingConstIterator::operator--(int)
+{
+ SettingConstIterator tmp(*this);
+ --_idx;
+
+ return(tmp);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator SettingConstIterator::operator+(int offset) const
+{
+ SettingConstIterator copy(*this);
+ copy += offset;
+
+ return(copy);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator& SettingConstIterator::operator+=(int offset)
+{
+ _idx += offset;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator operator+(int offset, SettingConstIterator &si)
+{
+ SettingConstIterator copy(si);
+ copy += offset;
+
+ return(copy);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator SettingConstIterator::operator-(int offset) const
+{
+ SettingConstIterator copy(*this);
+ copy -= offset;
+
+ return(copy);
+}
+
+// ---------------------------------------------------------------------------
+
+SettingConstIterator& SettingConstIterator::operator-=(int offset)
+{
+ _idx -= offset;
+
+ return(*this);
+}
+
+// ---------------------------------------------------------------------------
+
+int SettingConstIterator::operator-(SettingConstIterator const &other) const
+{
+ return(_idx - other._idx);
+}
+
+
+} // namespace libconfig
+
diff --git a/lib/libconfigcpp.cc b/lib/libconfigcpp.cc
new file mode 100644
index 0000000..cab4f64
--- /dev/null
+++ b/lib/libconfigcpp.cc
@@ -0,0 +1,23 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A structured configuration file parsing library
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ----------------------------------------------------------------------------
+*/
+
+#include "libconfigcpp.c++"
diff --git a/lib/parsectx.h b/lib/parsectx.h
new file mode 100644
index 0000000..02ce511
--- /dev/null
+++ b/lib/parsectx.h
@@ -0,0 +1,49 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __libconfig_parsectx_h
+#define __libconfig_parsectx_h
+
+#include "libconfig.h"
+#include "strbuf.h"
+#include "util.h"
+
+struct parse_context
+{
+ config_t *config;
+ config_setting_t *parent;
+ config_setting_t *setting;
+ char *name;
+ strbuf_t string;
+};
+
+#define libconfig_parsectx_init(C) \
+ __zero(C)
+#define libconfig_parsectx_cleanup(C) \
+ __delete(libconfig_strbuf_release(&((C)->string)))
+
+#define libconfig_parsectx_append_string(C, S) \
+ libconfig_strbuf_append_string(&((C)->string), (S))
+#define libconfig_parsectx_take_string(C) \
+ libconfig_strbuf_release(&((C)->string))
+
+#endif /* __libconfig_parsectx_h */
diff --git a/lib/scanctx.c b/lib/scanctx.c
new file mode 100644
index 0000000..02130ab
--- /dev/null
+++ b/lib/scanctx.c
@@ -0,0 +1,198 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "scanctx.h"
+#include "strvec.h"
+#include "wincompat.h"
+#include "util.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* ------------------------------------------------------------------------- */
+
+static const char *err_bad_include = "cannot open include file";
+static const char *err_include_too_deep = "include file nesting too deep";
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_scanctx_init(struct scan_context *ctx, const char *top_filename)
+{
+ __zero(ctx);
+ if(top_filename)
+ {
+ ctx->top_filename = strdup(top_filename);
+ libconfig_strvec_append(&(ctx->filenames), ctx->top_filename);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+const char **libconfig_scanctx_cleanup(struct scan_context *ctx)
+{
+ int i;
+
+ for(i = 0; i < ctx->stack_depth; ++i)
+ {
+ struct include_stack_frame *frame = &(ctx->include_stack[i]);
+
+ if(frame->current_stream)
+ fclose(frame->current_stream);
+
+ __delete(frame->files);
+ }
+
+ __delete(libconfig_strbuf_release(&(ctx->string)));
+
+ return(libconfig_strvec_release(&(ctx->filenames)));
+}
+
+/* ------------------------------------------------------------------------- */
+
+FILE *libconfig_scanctx_push_include(struct scan_context *ctx, void *prev_buffer,
+ const char *path, const char **error)
+{
+ struct include_stack_frame *frame;
+ const char **files = NULL, **f;
+ FILE *fp;
+
+ if(ctx->stack_depth == MAX_INCLUDE_DEPTH)
+ {
+ *error = err_include_too_deep;
+ return(NULL);
+ }
+
+ *error = NULL;
+
+ if(ctx->config->include_fn)
+ files = ctx->config->include_fn(ctx->config, ctx->config->include_dir,
+ path, error);
+
+ if(*error || !files)
+ {
+ libconfig_strvec_delete(files);
+ return(NULL);
+ }
+
+ if(!*files)
+ {
+ libconfig_strvec_delete(files);
+ return(NULL);
+ }
+
+ frame = &(ctx->include_stack[ctx->stack_depth]);
+
+ for(f = files; *f; ++f)
+ libconfig_strvec_append(&(ctx->filenames), *f);
+
+ frame->files = files;
+ frame->current_file = NULL;
+ frame->current_stream = NULL;
+ frame->parent_buffer = prev_buffer;
+ ++(ctx->stack_depth);
+
+ fp = libconfig_scanctx_next_include_file(ctx, error);
+ if(!fp)
+ (void)libconfig_scanctx_pop_include(ctx);
+
+ return(fp);
+}
+
+/* ------------------------------------------------------------------------- */
+
+FILE *libconfig_scanctx_next_include_file(struct scan_context *ctx,
+ const char **error)
+{
+ struct include_stack_frame *include_frame;
+
+ *error = NULL;
+
+ if(ctx->stack_depth == 0)
+ return(NULL);
+
+ include_frame = &(ctx->include_stack[ctx->stack_depth - 1]);
+
+ if(include_frame->current_file)
+ ++(include_frame->current_file);
+ else
+ include_frame->current_file = include_frame->files;
+
+ if(include_frame->current_stream)
+ {
+ fclose(include_frame->current_stream);
+ include_frame->current_stream = NULL;
+ }
+
+ if(!*(include_frame->current_file))
+ return(NULL);
+
+ include_frame->current_stream = fopen(*(include_frame->current_file), "rt");
+ if(!include_frame->current_stream)
+ *error = err_bad_include;
+
+ return(include_frame->current_stream);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void *libconfig_scanctx_pop_include(struct scan_context *ctx)
+{
+ struct include_stack_frame *frame;
+
+ if(ctx->stack_depth == 0)
+ return(NULL); /* stack underflow */
+
+ frame = &(ctx->include_stack[--(ctx->stack_depth)]);
+
+ __delete(frame->files);
+ frame->files = NULL;
+
+ if(frame->current_stream)
+ {
+ fclose(frame->current_stream);
+ frame->current_stream = NULL;
+ }
+
+ return(frame->parent_buffer);
+}
+
+/* ------------------------------------------------------------------------- */
+
+char *libconfig_scanctx_take_string(struct scan_context *ctx)
+{
+ char *r = libconfig_strbuf_release(&(ctx->string));
+
+ return(r ? r : strdup(""));
+}
+
+/* ------------------------------------------------------------------------- */
+
+const char *libconfig_scanctx_current_filename(struct scan_context *ctx)
+{
+ if(ctx->stack_depth > 0)
+ return(*(ctx->include_stack[ctx->stack_depth - 1].current_file));
+
+ return(ctx->top_filename);
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/lib/scanctx.h b/lib/scanctx.h
new file mode 100644
index 0000000..3c5c374
--- /dev/null
+++ b/lib/scanctx.h
@@ -0,0 +1,109 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __libconfig_scanctx_h
+#define __libconfig_scanctx_h
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "libconfig.h"
+#include "strbuf.h"
+#include "strvec.h"
+
+#define MAX_INCLUDE_DEPTH 10
+
+struct include_stack_frame
+{
+ /*
+ * Member strings are not owned; they are pointers into scan_context's
+ * filenames vector.
+ */
+ const char **files;
+ const char **current_file;
+ FILE *current_stream;
+ void *parent_buffer;
+};
+
+struct scan_context
+{
+ config_t *config;
+ const char *top_filename;
+ struct include_stack_frame include_stack[MAX_INCLUDE_DEPTH];
+ int stack_depth;
+ strbuf_t string;
+ strvec_t filenames;
+};
+
+extern void libconfig_scanctx_init(struct scan_context *ctx,
+ const char *top_filename);
+extern const char **libconfig_scanctx_cleanup(struct scan_context *ctx);
+
+/*
+ * Pushes a new frame onto the include stack, and returns an open stream to the
+ * first file in the include list, if any.
+ *
+ * ctx - The scan context
+ * prev_buffer - The current input buffer, to be restored when this frame is
+ * popped
+ * path - The string argument to the @include directive, to be expanded into a
+ * list of zero or more filenames using the function ctx->config->include_fn
+ * error - A pointer at which to store a static error message, if any.
+ *
+ * On success, the new frame will be pushed and the stream to the first file
+ * will be returned.
+ *
+ * On failure, the frame will not be pushed and NULL will be returned. If
+ * *error is NULL, it means there are no files in the list. Otherwise, it
+ * points to an error and parsing should be aborted.
+ */
+extern FILE *libconfig_scanctx_push_include(struct scan_context *ctx,
+ void *prev_buffer,
+ const char *path,
+ const char **error);
+
+/*
+ * Returns the next include file in the current include stack frame.
+ *
+ * Returns NULL on failure or if there are no more files left in the current
+ * frame. If there was an error, sets *error.
+ */
+extern FILE *libconfig_scanctx_next_include_file(struct scan_context *ctx,
+ const char **error);
+
+/*
+ * Pops a frame off the include stack.
+ */
+extern void *libconfig_scanctx_pop_include(struct scan_context *ctx);
+
+#define libconfig_scanctx_append_string(C, S) \
+ libconfig_strbuf_append_string(&((C)->string), (S))
+
+#define libconfig_scanctx_append_char(C, X) \
+ libconfig_strbuf_append_char(&((C)->string), (X))
+
+extern char *libconfig_scanctx_take_string(struct scan_context *ctx);
+
+extern const char *libconfig_scanctx_current_filename(struct scan_context *ctx);
+
+#endif /* __libconfig_scanctx_h */
diff --git a/lib/scanner.c b/lib/scanner.c
new file mode 100644
index 0000000..df1aed9
--- /dev/null
+++ b/lib/scanner.c
@@ -0,0 +1,2616 @@
+#line 1 "scanner.c"
+
+#line 3 "scanner.c"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+#ifdef yy_create_buffer
+#define libconfig_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer libconfig_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define libconfig_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer libconfig_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define libconfig_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer libconfig_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define libconfig_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string libconfig_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define libconfig_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes libconfig_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define libconfig_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer libconfig_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define libconfig_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer libconfig_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define libconfig_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state libconfig_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define libconfig_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer libconfig_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define libconfig_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state libconfig_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define libconfig_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state libconfig_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define libconfig_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack libconfig_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define libconfig_yylex_ALREADY_DEFINED
+#else
+#define yylex libconfig_yylex
+#endif
+
+#ifdef yyrestart
+#define libconfig_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart libconfig_yyrestart
+#endif
+
+#ifdef yylex_init
+#define libconfig_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init libconfig_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define libconfig_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra libconfig_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define libconfig_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy libconfig_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define libconfig_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug libconfig_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define libconfig_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug libconfig_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define libconfig_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra libconfig_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define libconfig_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra libconfig_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define libconfig_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in libconfig_yyget_in
+#endif
+
+#ifdef yyset_in
+#define libconfig_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in libconfig_yyset_in
+#endif
+
+#ifdef yyget_out
+#define libconfig_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out libconfig_yyget_out
+#endif
+
+#ifdef yyset_out
+#define libconfig_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out libconfig_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define libconfig_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng libconfig_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define libconfig_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text libconfig_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define libconfig_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno libconfig_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define libconfig_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno libconfig_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define libconfig_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column libconfig_yyget_column
+#endif
+
+#ifdef yyset_column
+#define libconfig_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column libconfig_yyset_column
+#endif
+
+#ifdef yywrap
+#define libconfig_yywrap_ALREADY_DEFINED
+#else
+#define yywrap libconfig_yywrap
+#endif
+
+#ifdef yyget_lval
+#define libconfig_yyget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval libconfig_yyget_lval
+#endif
+
+#ifdef yyset_lval
+#define libconfig_yyset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval libconfig_yyset_lval
+#endif
+
+#ifdef yyalloc
+#define libconfig_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc libconfig_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define libconfig_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc libconfig_yyrealloc
+#endif
+
+#ifdef yyfree
+#define libconfig_yyfree_ALREADY_DEFINED
+#else
+#define yyfree libconfig_yyfree
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+/* begin standard C++ headers. */
+
+/* TODO: this is always defined, so inline it */
+#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
+#else
+#define yynoreturn
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
+ */
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+ * access to the local variable yy_act. Since yyless() is a macro, it would break
+ * existing scanners that call yyless() from OUTSIDE yylex.
+ * One obvious solution it to make yy_act a global. I tried that, and saw
+ * a 5% performance hit in a non-yylineno scanner, because yy_act is
+ * normally declared as a register variable-- so it is not worth it.
+ */
+ #define YY_LESS_LINENO(n) \
+ do { \
+ int yyl;\
+ for ( yyl = n; yyl < yyleng; ++yyl )\
+ if ( yytext[yyl] == '\n' )\
+ --yylineno;\
+ }while(0)
+ #define YY_LINENO_REWIND_TO(dst) \
+ do {\
+ const char *p;\
+ for ( p = yy_cp-1; p >= (dst); --p)\
+ if ( *p == '\n' )\
+ --yylineno;\
+ }while(0)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = yyg->yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ int yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+ : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
+
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
+
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
+
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+
+#define yy_new_buffer yy_create_buffer
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ yyensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ yyensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+#define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1)
+#define YY_SKIP_YYWRAP
+typedef flex_uint8_t YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yyg->yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yyg->yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yyg->yy_c_buf_p = yy_cp;
+#define YY_NUM_RULES 44
+#define YY_END_OF_BUFFER 45
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static const flex_int16_t yy_accept[105] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 45, 43, 25, 24, 24, 8, 1, 40, 41, 32,
+ 43, 27, 33, 43, 34, 34, 26, 42, 32, 32,
+ 38, 39, 28, 29, 25, 43, 3, 2, 6, 7,
+ 6, 9, 18, 17, 20, 23, 44, 25, 32, 33,
+ 34, 33, 0, 4, 1, 33, 0, 35, 0, 32,
+ 32, 25, 0, 0, 5, 9, 15, 0, 14, 13,
+ 10, 11, 12, 20, 22, 21, 0, 33, 33, 0,
+ 0, 33, 35, 36, 32, 32, 0, 0, 0, 33,
+ 37, 32, 30, 0, 16, 37, 31, 0, 0, 0,
+
+ 0, 0, 19, 0
+ } ;
+
+static const YY_CHAR yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 4, 5, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 6, 7, 1, 1, 1, 1, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 18, 19, 1,
+ 20, 1, 1, 21, 22, 23, 23, 23, 24, 25,
+ 26, 26, 26, 26, 26, 27, 26, 26, 26, 26,
+ 26, 28, 29, 30, 31, 26, 26, 32, 26, 26,
+ 33, 34, 35, 1, 36, 1, 22, 23, 37, 38,
+
+ 39, 40, 26, 26, 41, 26, 26, 42, 26, 43,
+ 26, 26, 26, 44, 29, 45, 46, 26, 26, 32,
+ 26, 26, 47, 1, 48, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static const YY_CHAR yy_meta[49] =
+ { 0,
+ 1, 1, 1, 1, 1, 2, 1, 1, 1, 3,
+ 1, 1, 3, 1, 1, 4, 4, 1, 1, 1,
+ 1, 4, 4, 4, 4, 3, 3, 3, 3, 3,
+ 3, 3, 1, 2, 1, 3, 4, 4, 4, 4,
+ 3, 3, 3, 3, 3, 3, 1, 1
+ } ;
+
+static const flex_int16_t yy_base[115] =
+ { 0,
+ 0, 47, 199, 198, 47, 48, 46, 47, 48, 49,
+ 200, 203, 197, 203, 203, 203, 203, 203, 203, 0,
+ 45, 203, 47, 50, 60, 74, 203, 203, 176, 28,
+ 203, 203, 203, 203, 64, 156, 203, 203, 203, 203,
+ 181, 0, 203, 63, 0, 203, 83, 191, 0, 88,
+ 102, 98, 62, 203, 203, 104, 119, 162, 0, 67,
+ 65, 121, 127, 124, 203, 0, 203, 0, 203, 203,
+ 203, 203, 203, 0, 203, 203, 108, 117, 122, 134,
+ 132, 136, 203, 139, 136, 116, 126, 0, 140, 142,
+ 135, 130, 0, 102, 203, 203, 0, 85, 72, 63,
+
+ 98, 158, 203, 203, 169, 173, 177, 181, 183, 187,
+ 191, 89, 66, 63
+ } ;
+
+static const flex_int16_t yy_def[115] =
+ { 0,
+ 104, 1, 105, 105, 106, 106, 107, 107, 108, 108,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 109,
+ 104, 104, 104, 104, 104, 104, 104, 104, 109, 109,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 110, 104, 104, 111, 104, 104, 104, 109, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 112, 109,
+ 109, 104, 104, 104, 104, 110, 104, 113, 104, 104,
+ 104, 104, 104, 111, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 112, 109, 109, 104, 114, 104, 104,
+ 104, 109, 109, 104, 104, 104, 109, 104, 104, 104,
+
+ 104, 104, 104, 0, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104
+ } ;
+
+static const flex_int16_t yy_nxt[252] =
+ { 0,
+ 12, 13, 14, 15, 15, 16, 17, 18, 19, 20,
+ 21, 22, 21, 23, 24, 25, 26, 27, 28, 27,
+ 12, 20, 20, 20, 29, 20, 20, 20, 20, 30,
+ 20, 20, 31, 12, 32, 12, 20, 20, 20, 29,
+ 20, 20, 20, 20, 30, 20, 33, 34, 35, 40,
+ 40, 43, 43, 46, 46, 61, 41, 41, 50, 54,
+ 51, 51, 52, 52, 55, 62, 95, 36, 67, 88,
+ 53, 61, 77, 56, 77, 51, 51, 78, 78, 44,
+ 44, 47, 47, 57, 63, 53, 58, 56, 75, 51,
+ 51, 59, 84, 85, 68, 86, 69, 57, 57, 102,
+
+ 58, 101, 70, 52, 52, 71, 72, 73, 85, 100,
+ 86, 53, 57, 52, 52, 56, 76, 51, 51, 79,
+ 79, 53, 62, 78, 78, 57, 53, 80, 58, 81,
+ 99, 81, 78, 78, 82, 82, 53, 79, 79, 93,
+ 57, 63, 80, 98, 89, 80, 89, 82, 82, 90,
+ 90, 82, 82, 97, 93, 90, 90, 90, 90, 102,
+ 80, 96, 94, 103, 92, 91, 87, 64, 97, 37,
+ 37, 37, 37, 39, 39, 39, 39, 42, 42, 42,
+ 42, 45, 45, 45, 45, 49, 49, 66, 83, 66,
+ 66, 74, 48, 74, 74, 65, 64, 60, 48, 104,
+
+ 38, 38, 11, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104
+ } ;
+
+static const flex_int16_t yy_chk[252] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 5,
+ 6, 7, 8, 9, 10, 30, 5, 6, 21, 24,
+ 21, 21, 23, 23, 24, 35, 114, 2, 44, 113,
+ 23, 30, 53, 25, 53, 25, 25, 53, 53, 7,
+ 8, 9, 10, 25, 35, 23, 25, 26, 47, 26,
+ 26, 25, 112, 60, 44, 61, 44, 26, 25, 101,
+
+ 26, 100, 44, 50, 50, 44, 44, 44, 60, 99,
+ 61, 50, 26, 52, 52, 51, 47, 51, 51, 56,
+ 56, 52, 62, 77, 77, 51, 50, 56, 51, 57,
+ 98, 57, 78, 78, 57, 57, 52, 79, 79, 86,
+ 51, 62, 56, 94, 80, 79, 80, 81, 81, 80,
+ 80, 82, 82, 92, 86, 89, 89, 90, 90, 102,
+ 79, 91, 87, 102, 85, 84, 64, 63, 92, 105,
+ 105, 105, 105, 106, 106, 106, 106, 107, 107, 107,
+ 107, 108, 108, 108, 108, 109, 109, 110, 58, 110,
+ 110, 111, 48, 111, 111, 41, 36, 29, 13, 11,
+
+ 4, 3, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104
+ } ;
+
+/* Table of booleans, true if rule could match eol. */
+static const flex_int32_t yy_rule_can_match_eol[45] =
+ { 0,
+0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, };
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "scanner.l"
+/* -*- mode: C -*- */
+/* --------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+#define YY_NO_UNISTD_H 1
+#line 36 "scanner.l"
+
+#ifdef _MSC_VER
+#pragma warning (disable: 4996)
+#endif
+
+#include <stdlib.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <limits.h>
+
+#include "parsectx.h"
+#include "scanctx.h"
+#include "grammar.h"
+#include "wincompat.h"
+#include "util.h"
+
+#define YY_NO_INPUT // Suppress generation of useless input() function
+
+#line 803 "scanner.c"
+
+#line 805 "scanner.c"
+
+#define INITIAL 0
+#define SINGLE_LINE_COMMENT 1
+#define MULTI_LINE_COMMENT 2
+#define STRING 3
+#define INCLUDE 4
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE struct scan_context *
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+ {
+
+ /* User-defined. Not touched by flex. */
+ YY_EXTRA_TYPE yyextra_r;
+
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
+ FILE *yyin_r, *yyout_r;
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
+ char yy_hold_char;
+ int yy_n_chars;
+ int yyleng_r;
+ char *yy_c_buf_p;
+ int yy_init;
+ int yy_start;
+ int yy_did_buffer_switch_on_eof;
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int *yy_start_stack;
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ int yylineno_r;
+ int yy_flex_debug_r;
+
+ char *yytext_r;
+ int yy_more_flag;
+ int yy_more_len;
+
+ YYSTYPE * yylval_r;
+
+ }; /* end struct yyguts_t */
+
+static int yy_init_globals ( yyscan_t yyscanner );
+
+ /* This must go here because YYSTYPE and YYLTYPE are included
+ * from bison output in section 1.*/
+ # define yylval yyg->yylval_r
+
+int yylex_init (yyscan_t* scanner);
+
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy ( yyscan_t yyscanner );
+
+int yyget_debug ( yyscan_t yyscanner );
+
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
+
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
+
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
+
+FILE *yyget_in ( yyscan_t yyscanner );
+
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
+
+FILE *yyget_out ( yyscan_t yyscanner );
+
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
+
+ int yyget_leng ( yyscan_t yyscanner );
+
+char *yyget_text ( yyscan_t yyscanner );
+
+int yyget_lineno ( yyscan_t yyscanner );
+
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+int yyget_column ( yyscan_t yyscanner );
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
+
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
+
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap ( yyscan_t yyscanner );
+#else
+extern int yywrap ( yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput ( yyscan_t yyscanner );
+#else
+static int input ( yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ int n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner);
+
+#define YY_DECL int yylex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK /*LINTED*/break;
+#endif
+
+#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yylval = yylval_param;
+
+ if ( !yyg->yy_init )
+ {
+ yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yyg->yy_start )
+ yyg->yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
+ }
+
+ yy_load_buffer_state( yyscanner );
+ }
+
+ {
+#line 70 "scanner.l"
+
+
+#line 1085 "scanner.c"
+
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yyg->yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yyg->yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+yy_match:
+ do
+ {
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 105 )
+ yy_c = yy_meta[yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ ++yy_cp;
+ }
+ while ( yy_current_state != 104 );
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+
+ YY_DO_BEFORE_ACTION;
+
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+ {
+ int yyl;
+ for ( yyl = 0; yyl < yyleng; ++yyl )
+ if ( yytext[yyl] == '\n' )
+
+ do{ yylineno++;
+ yycolumn=0;
+ }while(0)
+;
+ }
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yyg->yy_hold_char;
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 72 "scanner.l"
+{ BEGIN SINGLE_LINE_COMMENT; }
+ YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+#line 73 "scanner.l"
+{ BEGIN INITIAL; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 74 "scanner.l"
+{ /* ignore */ }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 76 "scanner.l"
+{ BEGIN MULTI_LINE_COMMENT; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 77 "scanner.l"
+{ BEGIN INITIAL; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 78 "scanner.l"
+{ /* ignore */ }
+ YY_BREAK
+case 7:
+/* rule 7 can match eol */
+YY_RULE_SETUP
+#line 79 "scanner.l"
+{ /* ignore */ }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 81 "scanner.l"
+{ BEGIN STRING; }
+ YY_BREAK
+case 9:
+/* rule 9 can match eol */
+YY_RULE_SETUP
+#line 82 "scanner.l"
+{ libconfig_scanctx_append_string(yyextra, yytext); }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 83 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\n'); }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 84 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\r'); }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 85 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\t'); }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 86 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\f'); }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 87 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\\'); }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 88 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\"'); }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 89 "scanner.l"
+{
+ char c = (char)(strtol(yytext + 2, NULL, 16) & 0xFF);
+ libconfig_scanctx_append_char(yyextra, c);
+ }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 93 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\\'); }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 94 "scanner.l"
+{
+ yylval->sval = libconfig_scanctx_take_string(yyextra);
+ BEGIN INITIAL;
+ return(TOK_STRING);
+ }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 100 "scanner.l"
+{ BEGIN INCLUDE; }
+ YY_BREAK
+case 20:
+/* rule 20 can match eol */
+YY_RULE_SETUP
+#line 101 "scanner.l"
+{ libconfig_scanctx_append_string(yyextra, yytext); }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 102 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\\'); }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 103 "scanner.l"
+{ libconfig_scanctx_append_char(yyextra, '\"'); }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 104 "scanner.l"
+{
+ const char *error = NULL;
+ const char *path = libconfig_scanctx_take_string(yyextra);
+ FILE *fp = libconfig_scanctx_push_include(yyextra, (void *)YY_CURRENT_BUFFER,
+ path, &error);
+ __delete(path);
+
+ if(fp)
+ {
+ yyin = fp;
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner),
+ yyscanner);
+ }
+ else if(error)
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ return TOK_ERROR;
+ }
+ BEGIN INITIAL;
+}
+ YY_BREAK
+case 24:
+/* rule 24 can match eol */
+YY_RULE_SETUP
+#line 127 "scanner.l"
+{ /* ignore */ }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 128 "scanner.l"
+{ /* ignore */ }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 130 "scanner.l"
+{ return(TOK_EQUALS); }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 131 "scanner.l"
+{ return(TOK_COMMA); }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 132 "scanner.l"
+{ return(TOK_GROUP_START); }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 133 "scanner.l"
+{ return(TOK_GROUP_END); }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 134 "scanner.l"
+{ yylval->ival = 1; return(TOK_BOOLEAN); }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 135 "scanner.l"
+{ yylval->ival = 0; return(TOK_BOOLEAN); }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 136 "scanner.l"
+{ yylval->sval = yytext; return(TOK_NAME); }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 137 "scanner.l"
+{ yylval->fval = atof(yytext); return(TOK_FLOAT); }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 138 "scanner.l"
+{
+ int ok;
+ long long llval = libconfig_parse_integer(yytext, &ok);
+ if(!ok)
+ return(TOK_ERROR);
+
+ if((llval < INT_MIN) || (llval > INT_MAX))
+ {
+ yylval->llval = llval;
+ return(TOK_INTEGER64);
+ }
+ else
+ {
+ yylval->ival = (int)llval;
+ return(TOK_INTEGER);
+ }
+ }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 155 "scanner.l"
+{ yylval->llval = atoll(yytext); return(TOK_INTEGER64); }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 156 "scanner.l"
+{
+ yylval->ival = strtoul(yytext, NULL, 16);
+ return(TOK_HEX);
+ }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 160 "scanner.l"
+{
+ yylval->llval = libconfig_parse_hex64(yytext);
+ return(TOK_HEX64);
+ }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 164 "scanner.l"
+{ return(TOK_ARRAY_START); }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 165 "scanner.l"
+{ return(TOK_ARRAY_END); }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 166 "scanner.l"
+{ return(TOK_LIST_START); }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 167 "scanner.l"
+{ return(TOK_LIST_END); }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 168 "scanner.l"
+{ return(TOK_SEMICOLON); }
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 169 "scanner.l"
+{ return(TOK_GARBAGE); }
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(SINGLE_LINE_COMMENT):
+case YY_STATE_EOF(MULTI_LINE_COMMENT):
+case YY_STATE_EOF(STRING):
+case YY_STATE_EOF(INCLUDE):
+#line 171 "scanner.l"
+{
+ const char *error = NULL;
+ FILE *fp;
+
+ fp = libconfig_scanctx_next_include_file(yyextra, &error);
+ if(fp)
+ {
+ yyin = fp;
+ yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner),
+ yyscanner);
+ }
+ else if(error)
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ return TOK_ERROR;
+ }
+ else
+ {
+ /* No more files in the current include list. */
+ YY_BUFFER_STATE buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(yyextra);
+ if(buf)
+ {
+ yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
+ yy_switch_to_buffer(buf, yyscanner);
+ }
+ else
+ yyterminate();
+ }
+}
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 203 "scanner.l"
+ECHO;
+ YY_BREAK
+#line 1465 "scanner.c"
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yyg->yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yyg->yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yyg->yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap( yyscanner ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p =
+ yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yyg->yy_c_buf_p =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of user's declarations */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = yyg->yytext_ptr;
+ int number_to_move, i;
+ int ret_val;
+
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+
+ int yy_c_buf_p_offset =
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = NULL;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ yyg->yy_n_chars, num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ if ( yyg->yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin , yyscanner);
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
+ }
+
+ yyg->yy_n_chars += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+ yy_state_type yy_current_state;
+ char *yy_cp;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+ {
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 105 )
+ yy_c = yy_meta[yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
+{
+ int yy_is_jam;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+ char *yy_cp = yyg->yy_c_buf_p;
+
+ YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 105 )
+ yy_c = yy_meta[yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ yy_is_jam = (yy_current_state == 104);
+
+ (void)yyg;
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+#ifndef YY_NO_UNPUT
+
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (yyscan_t yyscanner)
+#else
+ static int input (yyscan_t yyscanner)
+#endif
+
+{
+ int c;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ /* This was really a NUL. */
+ *yyg->yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
+ ++yyg->yy_c_buf_p;
+
+ switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart( yyin , yyscanner);
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap( yyscanner ) )
+ return 0;
+
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput(yyscanner);
+#else
+ return input(yyscanner);
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
+
+ do{ yylineno++;
+ yycolumn=0;
+ }while(0)
+;
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * @param yyscanner The scanner object.
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! YY_CURRENT_BUFFER ){
+ yyensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
+ }
+
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * @param yyscanner The scanner object.
+ */
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
+ */
+ yyensure_buffer_stack (yyscanner);
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy_load_buffer_state( yyscanner );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+static void yy_load_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file , yyscanner);
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * @param yyscanner The scanner object.
+ */
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
+
+ yyfree( (void *) b , yyscanner );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+
+{
+ int oerrno = errno;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yy_flush_buffer( b , yyscanner);
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
+ */
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ yy_load_buffer_state( yyscanner );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ * @param yyscanner The scanner object.
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (new_buffer == NULL)
+ return;
+
+ yyensure_buffer_stack(yyscanner);
+
+ /* This block is copied from yy_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ yyg->yy_buffer_stack_top++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ * @param yyscanner The scanner object.
+ */
+void yypop_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if (yyg->yy_buffer_stack_top > 0)
+ --yyg->yy_buffer_stack_top;
+
+ if (YY_CURRENT_BUFFER) {
+ yy_load_buffer_state( yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (yyscan_t yyscanner)
+{
+ yy_size_t num_to_alloc;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (!yyg->yy_buffer_stack) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ yyg->yy_buffer_stack_top = 0;
+ return;
+ }
+
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ yy_size_t grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
+ (yyg->yy_buffer_stack,
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return NULL;
+
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = NULL;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b , yyscanner );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
+{
+
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
+
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n , yyscanner);
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+ fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = yyg->yy_hold_char; \
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+ *yyg->yy_c_buf_p = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the user-defined data for this scanner.
+ * @param yyscanner The scanner object.
+ */
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyextra;
+}
+
+/** Get the current line number.
+ * @param yyscanner The scanner object.
+ */
+int yyget_lineno (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yylineno;
+}
+
+/** Get the current column number.
+ * @param yyscanner The scanner object.
+ */
+int yyget_column (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yycolumn;
+}
+
+/** Get the input stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *yyget_in (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyin;
+}
+
+/** Get the output stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *yyget_out (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyout;
+}
+
+/** Get the length of the current token.
+ * @param yyscanner The scanner object.
+ */
+int yyget_leng (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyleng;
+}
+
+/** Get the current token.
+ * @param yyscanner The scanner object.
+ */
+
+char *yyget_text (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yytext;
+}
+
+/** Set the user-defined data. This data is never touched by the scanner.
+ * @param user_defined The data to be associated with this scanner.
+ * @param yyscanner The scanner object.
+ */
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyextra = user_defined ;
+}
+
+/** Set the current line number.
+ * @param _line_number line number
+ * @param yyscanner The scanner object.
+ */
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* lineno is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
+
+ yylineno = _line_number;
+}
+
+/** Set the current column.
+ * @param _column_no column number
+ * @param yyscanner The scanner object.
+ */
+void yyset_column (int _column_no , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* column is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
+
+ yycolumn = _column_no;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param _in_str A readable stream.
+ * @param yyscanner The scanner object.
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyin = _in_str ;
+}
+
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyout = _out_str ;
+}
+
+int yyget_debug (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yy_flex_debug;
+}
+
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yy_flex_debug = _bdebug ;
+}
+
+/* Accessor methods for yylval and yylloc */
+
+YYSTYPE * yyget_lval (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yylval;
+}
+
+void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yylval = yylval_param;
+}
+
+/* User-visible API */
+
+/* yylex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+int yylex_init(yyscan_t* ptr_yy_globals)
+{
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to yyalloc in
+ * the yyextra field.
+ */
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
+{
+ struct yyguts_t dummy_yyguts;
+
+ yyset_extra (yy_user_defined, &dummy_yyguts);
+
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in
+ yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+static int yy_init_globals (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from yylex_destroy(), so don't allocate here.
+ */
+
+ yyg->yy_buffer_stack = NULL;
+ yyg->yy_buffer_stack_top = 0;
+ yyg->yy_buffer_stack_max = 0;
+ yyg->yy_c_buf_p = NULL;
+ yyg->yy_init = 0;
+ yyg->yy_start = 0;
+
+ yyg->yy_start_stack_ptr = 0;
+ yyg->yy_start_stack_depth = 0;
+ yyg->yy_start_stack = NULL;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ yyin = stdin;
+ yyout = stdout;
+#else
+ yyin = NULL;
+ yyout = NULL;
+#endif
+
+ /* For future reference: Set errno on error, since we are called by
+ * yylex_init()
+ */
+ return 0;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yypop_buffer_state(yyscanner);
+ }
+
+ /* Destroy the stack itself. */
+ yyfree(yyg->yy_buffer_stack , yyscanner);
+ yyg->yy_buffer_stack = NULL;
+
+ /* Destroy the start condition stack. */
+ yyfree( yyg->yy_start_stack , yyscanner );
+ yyg->yy_start_stack = NULL;
+
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * yylex() is called, initialization will occur. */
+ yy_init_globals( yyscanner);
+
+ /* Destroy the main struct (reentrant only). */
+ yyfree ( yyscanner , yyscanner );
+ yyscanner = NULL;
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+
+ int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
+{
+ int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+ return malloc(size);
+}
+
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return realloc(ptr, size);
+}
+
+void yyfree (void * ptr , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 203 "scanner.l"
diff --git a/lib/scanner.h b/lib/scanner.h
new file mode 100644
index 0000000..b902fd9
--- /dev/null
+++ b/lib/scanner.h
@@ -0,0 +1,719 @@
+#ifndef libconfig_yyHEADER_H
+#define libconfig_yyHEADER_H 1
+#define libconfig_yyIN_HEADER 1
+
+#line 5 "scanner.h"
+
+#line 7 "scanner.h"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+#ifdef yy_create_buffer
+#define libconfig_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer libconfig_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define libconfig_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer libconfig_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define libconfig_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer libconfig_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define libconfig_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string libconfig_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define libconfig_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes libconfig_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define libconfig_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer libconfig_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define libconfig_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer libconfig_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define libconfig_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state libconfig_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define libconfig_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer libconfig_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define libconfig_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state libconfig_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define libconfig_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state libconfig_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define libconfig_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack libconfig_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define libconfig_yylex_ALREADY_DEFINED
+#else
+#define yylex libconfig_yylex
+#endif
+
+#ifdef yyrestart
+#define libconfig_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart libconfig_yyrestart
+#endif
+
+#ifdef yylex_init
+#define libconfig_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init libconfig_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define libconfig_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra libconfig_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define libconfig_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy libconfig_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define libconfig_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug libconfig_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define libconfig_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug libconfig_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define libconfig_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra libconfig_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define libconfig_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra libconfig_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define libconfig_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in libconfig_yyget_in
+#endif
+
+#ifdef yyset_in
+#define libconfig_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in libconfig_yyset_in
+#endif
+
+#ifdef yyget_out
+#define libconfig_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out libconfig_yyget_out
+#endif
+
+#ifdef yyset_out
+#define libconfig_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out libconfig_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define libconfig_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng libconfig_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define libconfig_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text libconfig_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define libconfig_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno libconfig_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define libconfig_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno libconfig_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define libconfig_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column libconfig_yyget_column
+#endif
+
+#ifdef yyset_column
+#define libconfig_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column libconfig_yyset_column
+#endif
+
+#ifdef yywrap
+#define libconfig_yywrap_ALREADY_DEFINED
+#else
+#define yywrap libconfig_yywrap
+#endif
+
+#ifdef yyget_lval
+#define libconfig_yyget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval libconfig_yyget_lval
+#endif
+
+#ifdef yyset_lval
+#define libconfig_yyset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval libconfig_yyset_lval
+#endif
+
+#ifdef yyalloc
+#define libconfig_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc libconfig_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define libconfig_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc libconfig_yyrealloc
+#endif
+
+#ifdef yyfree
+#define libconfig_yyfree_ALREADY_DEFINED
+#else
+#define yyfree libconfig_yyfree
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+/* begin standard C++ headers. */
+
+/* TODO: this is always defined, so inline it */
+#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
+#else
+#define yynoreturn
+#endif
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ int yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
+
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
+
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+
+#define libconfig_yywrap(yyscanner) (/*CONSTCOND*/1)
+#define YY_SKIP_YYWRAP
+
+#define yytext_ptr yytext_r
+
+#ifdef YY_HEADER_EXPORT_START_CONDITIONS
+#define INITIAL 0
+#define SINGLE_LINE_COMMENT 1
+#define MULTI_LINE_COMMENT 2
+#define STRING 3
+#define INCLUDE 4
+
+#endif
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE struct scan_context *
+
+int yylex_init (yyscan_t* scanner);
+
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy ( yyscan_t yyscanner );
+
+int yyget_debug ( yyscan_t yyscanner );
+
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
+
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
+
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
+
+FILE *yyget_in ( yyscan_t yyscanner );
+
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
+
+FILE *yyget_out ( yyscan_t yyscanner );
+
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
+
+ int yyget_leng ( yyscan_t yyscanner );
+
+char *yyget_text ( yyscan_t yyscanner );
+
+int yyget_lineno ( yyscan_t yyscanner );
+
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+int yyget_column ( yyscan_t yyscanner );
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
+
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
+
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap ( yyscan_t yyscanner );
+#else
+extern int yywrap ( yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner);
+
+#define YY_DECL int yylex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+
+#ifndef libconfig_yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef libconfig_yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef libconfig_yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef libconfig_yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef libconfig_yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef libconfig_yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef libconfig_yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef libconfig_yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef libconfig_yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef libconfig_yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef libconfig_yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef libconfig_yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef libconfig_yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef libconfig_yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef libconfig_yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef libconfig_yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef libconfig_yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef libconfig_yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef libconfig_yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef libconfig_yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef libconfig_yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef libconfig_yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef libconfig_yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef libconfig_yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef libconfig_yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef libconfig_yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef libconfig_yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef libconfig_yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef libconfig_yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef libconfig_yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef libconfig_yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef libconfig_yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef libconfig_yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef libconfig_yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef libconfig_yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef libconfig_yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef libconfig_yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef libconfig_yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef libconfig_yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef libconfig_yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef libconfig_yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef libconfig_yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef libconfig_yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef libconfig_yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef libconfig_yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef libconfig_yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef libconfig_yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef libconfig_yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
+
+#line 203 "scanner.l"
+
+#line 717 "scanner.h"
+#undef libconfig_yyIN_HEADER
+#endif /* libconfig_yyHEADER_H */
diff --git a/lib/scanner.l b/lib/scanner.l
new file mode 100644
index 0000000..21c1271
--- /dev/null
+++ b/lib/scanner.l
@@ -0,0 +1,202 @@
+/* -*- mode: C -*- */
+/* --------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+%option nounistd
+%option never-interactive
+%option reentrant
+%option noyywrap
+%option yylineno
+%option nounput
+%option bison-bridge
+%option header-file="scanner.h"
+%option outfile="lex.yy.c"
+%option extra-type="struct scan_context *"
+
+%{
+
+#ifdef _MSC_VER
+#pragma warning (disable: 4996)
+#endif
+
+#include <stdlib.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <limits.h>
+
+#include "parsectx.h"
+#include "scanctx.h"
+#include "grammar.h"
+#include "wincompat.h"
+#include "util.h"
+
+#define YY_NO_INPUT // Suppress generation of useless input() function
+
+%}
+
+true [Tt][Rr][Uu][Ee]
+false [Ff][Aa][Ll][Ss][Ee]
+name [A-Za-z\*][-A-Za-z0-9_\*]*
+integer [-+]?[0-9]+
+integer64 [-+]?[0-9]+L(L)?
+hex 0[Xx][0-9A-Fa-f]+
+hex64 0[Xx][0-9A-Fa-f]+L(L)?
+hexchar \\[Xx][0-9A-Fa-f]{2}
+float ([-+]?([0-9]*)?\.[0-9]*([eE][-+]?[0-9]+)?)|([-+]?([0-9]+)(\.[0-9]*)?[eE][-+]?[0-9]+)
+include_open ^[ \t]*@include[ \t]+\"
+
+%x SINGLE_LINE_COMMENT MULTI_LINE_COMMENT STRING INCLUDE
+
+%%
+
+(#|\/\/) { BEGIN SINGLE_LINE_COMMENT; }
+<SINGLE_LINE_COMMENT>\n { BEGIN INITIAL; }
+<SINGLE_LINE_COMMENT>. { /* ignore */ }
+
+\/\* { BEGIN MULTI_LINE_COMMENT; }
+<MULTI_LINE_COMMENT>\*\/ { BEGIN INITIAL; }
+<MULTI_LINE_COMMENT>. { /* ignore */ }
+<MULTI_LINE_COMMENT>\n { /* ignore */ }
+
+\" { BEGIN STRING; }
+<STRING>[^\"\\]+ { libconfig_scanctx_append_string(yyextra, yytext); }
+<STRING>\\n { libconfig_scanctx_append_char(yyextra, '\n'); }
+<STRING>\\r { libconfig_scanctx_append_char(yyextra, '\r'); }
+<STRING>\\t { libconfig_scanctx_append_char(yyextra, '\t'); }
+<STRING>\\f { libconfig_scanctx_append_char(yyextra, '\f'); }
+<STRING>\\\\ { libconfig_scanctx_append_char(yyextra, '\\'); }
+<STRING>\\\" { libconfig_scanctx_append_char(yyextra, '\"'); }
+<STRING>{hexchar} {
+ char c = (char)(strtol(yytext + 2, NULL, 16) & 0xFF);
+ libconfig_scanctx_append_char(yyextra, c);
+ }
+<STRING>\\ { libconfig_scanctx_append_char(yyextra, '\\'); }
+<STRING>\" {
+ yylval->sval = libconfig_scanctx_take_string(yyextra);
+ BEGIN INITIAL;
+ return(TOK_STRING);
+ }
+
+{include_open} { BEGIN INCLUDE; }
+<INCLUDE>[^\"\\]+ { libconfig_scanctx_append_string(yyextra, yytext); }
+<INCLUDE>\\\\ { libconfig_scanctx_append_char(yyextra, '\\'); }
+<INCLUDE>\\\" { libconfig_scanctx_append_char(yyextra, '\"'); }
+<INCLUDE>\" {
+ const char *error = NULL;
+ const char *path = libconfig_scanctx_take_string(yyextra);
+ FILE *fp = libconfig_scanctx_push_include(yyextra, (void *)YY_CURRENT_BUFFER,
+ path, &error);
+ __delete(path);
+
+ if(fp)
+ {
+ yyin = fp;
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner),
+ yyscanner);
+ }
+ else if(error)
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ return TOK_ERROR;
+ }
+ BEGIN INITIAL;
+}
+
+\n|\r|\f { /* ignore */ }
+[ \t]+ { /* ignore */ }
+
+\=|\: { return(TOK_EQUALS); }
+, { return(TOK_COMMA); }
+\{ { return(TOK_GROUP_START); }
+\} { return(TOK_GROUP_END); }
+{true} { yylval->ival = 1; return(TOK_BOOLEAN); }
+{false} { yylval->ival = 0; return(TOK_BOOLEAN); }
+{name} { yylval->sval = yytext; return(TOK_NAME); }
+{float} { yylval->fval = atof(yytext); return(TOK_FLOAT); }
+{integer} {
+ int ok;
+ long long llval = libconfig_parse_integer(yytext, &ok);
+ if(!ok)
+ return(TOK_ERROR);
+
+ if((llval < INT_MIN) || (llval > INT_MAX))
+ {
+ yylval->llval = llval;
+ return(TOK_INTEGER64);
+ }
+ else
+ {
+ yylval->ival = (int)llval;
+ return(TOK_INTEGER);
+ }
+ }
+{integer64} { yylval->llval = atoll(yytext); return(TOK_INTEGER64); }
+{hex} {
+ yylval->ival = strtoul(yytext, NULL, 16);
+ return(TOK_HEX);
+ }
+{hex64} {
+ yylval->llval = libconfig_parse_hex64(yytext);
+ return(TOK_HEX64);
+ }
+\[ { return(TOK_ARRAY_START); }
+\] { return(TOK_ARRAY_END); }
+\( { return(TOK_LIST_START); }
+\) { return(TOK_LIST_END); }
+; { return(TOK_SEMICOLON); }
+. { return(TOK_GARBAGE); }
+
+<<EOF>> {
+ const char *error = NULL;
+ FILE *fp;
+
+ fp = libconfig_scanctx_next_include_file(yyextra, &error);
+ if(fp)
+ {
+ yyin = fp;
+ yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner),
+ yyscanner);
+ }
+ else if(error)
+ {
+ yyextra->config->error_text = error;
+ yyextra->config->error_file = libconfig_scanctx_current_filename(yyextra);
+ yyextra->config->error_line = libconfig_yyget_lineno(yyscanner);
+ return TOK_ERROR;
+ }
+ else
+ {
+ /* No more files in the current include list. */
+ YY_BUFFER_STATE buf = (YY_BUFFER_STATE)libconfig_scanctx_pop_include(yyextra);
+ if(buf)
+ {
+ yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
+ yy_switch_to_buffer(buf, yyscanner);
+ }
+ else
+ yyterminate();
+ }
+}
diff --git a/lib/strbuf.c b/lib/strbuf.c
new file mode 100644
index 0000000..fa2d913
--- /dev/null
+++ b/lib/strbuf.c
@@ -0,0 +1,74 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "strbuf.h"
+#include "util.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+#define STRING_BLOCK_SIZE 64
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_strbuf_ensure_capacity(strbuf_t *buf, size_t len)
+{
+ static const size_t mask = ~(STRING_BLOCK_SIZE - 1);
+
+ size_t newlen = buf->length + len + 1; /* add 1 for NUL */
+ if(newlen > buf->capacity)
+ {
+ buf->capacity = (newlen + (STRING_BLOCK_SIZE - 1)) & mask;
+ buf->string = (char *)realloc(buf->string, buf->capacity);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+char *libconfig_strbuf_release(strbuf_t *buf)
+{
+ char *r = buf->string;
+ __zero(buf);
+ return(r);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_strbuf_append_string(strbuf_t *buf, const char *s)
+{
+ size_t len = strlen(s);
+ libconfig_strbuf_ensure_capacity(buf, len);
+ strcpy(buf->string + buf->length, s);
+ buf->length += len;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_strbuf_append_char(strbuf_t *buf, char c)
+{
+ libconfig_strbuf_ensure_capacity(buf, 1);
+ *(buf->string + buf->length) = c;
+ ++(buf->length);
+ *(buf->string + buf->length) = '\0';
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/lib/strbuf.h b/lib/strbuf.h
new file mode 100644
index 0000000..0bc9b13
--- /dev/null
+++ b/lib/strbuf.h
@@ -0,0 +1,42 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __libconfig_strbuf_h
+#define __libconfig_strbuf_h
+
+#include <string.h>
+#include <sys/types.h>
+
+typedef struct
+{
+ char *string;
+ size_t length;
+ size_t capacity;
+} strbuf_t;
+
+void libconfig_strbuf_append_string(strbuf_t *buf, const char *s);
+
+void libconfig_strbuf_append_char(strbuf_t *buf, char c);
+
+char *libconfig_strbuf_release(strbuf_t *buf);
+
+#endif /* __libconfig_strbuf_h */
diff --git a/lib/strvec.c b/lib/strvec.c
new file mode 100644
index 0000000..e1c3daa
--- /dev/null
+++ b/lib/strvec.c
@@ -0,0 +1,74 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "strvec.h"
+#include "util.h"
+
+#include <stdlib.h>
+
+#define CHUNK_SIZE 32
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_strvec_append(strvec_t *vec, const char *s)
+{
+ if(vec->length == vec->capacity)
+ {
+ vec->capacity += CHUNK_SIZE;
+ vec->strings = (const char **)realloc(
+ (void *)vec->strings,
+ (vec->capacity + 1) * sizeof(const char *));
+ vec->end = vec->strings + vec->length;
+ }
+
+ *(vec->end) = s;
+ ++(vec->end);
+ ++(vec->length);
+}
+
+/* ------------------------------------------------------------------------- */
+
+const char **libconfig_strvec_release(strvec_t *vec)
+{
+ const char **r = vec->strings;
+ if(r)
+ *(vec->end) = NULL;
+
+ __zero(vec);
+ return(r);
+}
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_strvec_delete(const char *const *vec)
+{
+ const char *const *p;
+
+ if(!vec) return;
+
+ for(p = vec; *p; ++p)
+ __delete(*p);
+
+ __delete(vec);
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/lib/strvec.h b/lib/strvec.h
new file mode 100644
index 0000000..e90aa2c
--- /dev/null
+++ b/lib/strvec.h
@@ -0,0 +1,43 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2020 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __libconfig_strvec_h
+#define __libconfig_strvec_h
+
+#include <string.h>
+#include <sys/types.h>
+
+typedef struct
+{
+ const char **strings;
+ const char **end;
+ size_t length;
+ size_t capacity;
+} strvec_t;
+
+extern void libconfig_strvec_append(strvec_t *vec, const char *s);
+
+extern const char **libconfig_strvec_release(strvec_t *vec);
+
+extern void libconfig_strvec_delete(const char * const *vec);
+
+#endif /* __libconfig_strvec_h */
diff --git a/lib/util.c b/lib/util.c
new file mode 100644
index 0000000..b4b00b8
--- /dev/null
+++ b/lib/util.c
@@ -0,0 +1,122 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "util.h"
+#include "wincompat.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* ------------------------------------------------------------------------- */
+
+long long libconfig_parse_integer(const char *s, int *ok)
+{
+ long long llval;
+ char *endptr;
+ int errsave = errno;
+ errno = 0;
+ llval = strtoll(s, &endptr, 0); /* base 10 or base 8 */
+ if(*endptr || errno)
+ {
+ errno = 0;
+ *ok = 0;
+ return(0); /* parse error */
+ }
+ errno = errsave;
+
+ *ok = 1;
+ return(llval);
+}
+
+/* ------------------------------------------------------------------------- */
+
+unsigned long long libconfig_parse_hex64(const char *s)
+{
+#ifdef __MINGW32__
+
+ /* MinGW's strtoull() seems to be broken; it only returns the lower
+ * 32 bits...
+ */
+
+ const char *p = s;
+ unsigned long long val = 0;
+
+ if(*p != '0')
+ return(0);
+
+ ++p;
+
+ if(*p != 'x' && *p != 'X')
+ return(0);
+
+ for(++p; isxdigit(*p); ++p)
+ {
+ val <<= 4;
+ val |= ((*p < 'A') ? (*p & 0xF) : (9 + (*p & 0x7)));
+ }
+
+ return(val);
+
+#else /* ! __MINGW32__ */
+
+ return(strtoull(s, NULL, 16));
+
+#endif /* __MINGW32__ */
+}
+
+/* ------------------------------------------------------------------------- */
+
+void libconfig_format_double(double val, int precision, int sci_ok, char *buf,
+ size_t buflen)
+{
+ const char *fmt = sci_ok ? "%.*g" : "%.*f";
+ char *p, *q;
+
+ snprintf(buf, buflen - 3, fmt, precision, val);
+
+ /* Check for exponent. */
+ p = strchr(buf, 'e');
+ if(p) return;
+
+ /* Check for decimal point. */
+ p = strchr(buf, '.');
+ if(!p)
+ {
+ /* No decimal point. Add trailing ".0". */
+ strcat(buf, ".0");
+ }
+ else
+ {
+ /* Remove any excess trailing 0's after decimal point. */
+ for(q = buf + strlen(buf) - 1; q > p + 1; --q)
+ {
+ if(*q == '0')
+ *q = '\0';
+ else
+ break;
+ }
+ }
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/lib/util.h b/lib/util.h
new file mode 100644
index 0000000..9cd2463
--- /dev/null
+++ b/lib/util.h
@@ -0,0 +1,35 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <string.h>
+#include <sys/types.h>
+
+#define __new(T) (T *)calloc(1, sizeof(T)) /* zeroed */
+#define __delete(P) free((void *)(P))
+#define __zero(P) memset((void *)(P), 0, sizeof(*P))
+
+extern long long libconfig_parse_integer(const char *s, int *ok);
+extern unsigned long long libconfig_parse_hex64(const char *s);
+
+extern void libconfig_format_double(double val, int precision, int sci_ok,
+ char *buf, size_t buflen);
+
diff --git a/lib/win32/stdint.h b/lib/win32/stdint.h
new file mode 100644
index 0000000..71c0776
--- /dev/null
+++ b/lib/win32/stdint.h
@@ -0,0 +1,221 @@
+// ISO C9x compliant stdint.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006 Alexander Chemeris
+//
+// 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.
+//
+// 3. The name of the author may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_STDINT_H_ // [
+#define _MSC_STDINT_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include <limits.h>
+
+// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
+// or compiler give many errors like this:
+// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+#if (_MSC_VER < 1300) && defined(__cplusplus)
+ extern "C++" {
+#endif
+# include <wchar.h>
+#if (_MSC_VER < 1300) && defined(__cplusplus)
+ }
+#endif
+
+// 7.18.1 Integer types
+
+// 7.18.1.1 Exact-width integer types
+typedef __int8 int8_t;
+typedef __int16 int16_t;
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+
+// 7.18.1.2 Minimum-width integer types
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
+
+// 7.18.1.3 Fastest minimum-width integer types
+typedef int8_t int_fast8_t;
+typedef int16_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef int64_t int_fast64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint16_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+typedef uint64_t uint_fast64_t;
+
+// 7.18.1.4 Integer types capable of holding object pointers
+#ifdef _WIN64 // [
+ typedef __int64 intptr_t;
+ typedef unsigned __int64 uintptr_t;
+#else // _WIN64 ][
+ typedef int intptr_t;
+ typedef unsigned int uintptr_t;
+#endif // _WIN64 ]
+
+// 7.18.1.5 Greatest-width integer types
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
+
+
+// 7.18.2 Limits of specified-width integer types
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
+
+// 7.18.2.1 Limits of exact-width integer types
+#define INT8_MIN ((int8_t)_I8_MIN)
+#define INT8_MAX _I8_MAX
+#define INT16_MIN ((int16_t)_I16_MIN)
+#define INT16_MAX _I16_MAX
+#define INT32_MIN ((int32_t)_I32_MIN)
+#define INT32_MAX _I32_MAX
+#define INT64_MIN ((int64_t)_I64_MIN)
+#define INT64_MAX _I64_MAX
+#define UINT8_MAX _UI8_MAX
+#define UINT16_MAX _UI16_MAX
+#define UINT32_MAX _UI32_MAX
+#define UINT64_MAX _UI64_MAX
+
+// 7.18.2.2 Limits of minimum-width integer types
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MIN INT64_MIN
+#define INT_LEAST64_MAX INT64_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+// 7.18.2.3 Limits of fastest minimum-width integer types
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MIN INT64_MIN
+#define INT_FAST64_MAX INT64_MAX
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+// 7.18.2.4 Limits of integer types capable of holding object pointers
+#ifdef _WIN64 // [
+# define INTPTR_MIN INT64_MIN
+# define INTPTR_MAX INT64_MAX
+# define UINTPTR_MAX UINT64_MAX
+#else // _WIN64 ][
+# define INTPTR_MIN INT32_MIN
+# define INTPTR_MAX INT32_MAX
+# define UINTPTR_MAX UINT32_MAX
+#endif // _WIN64 ]
+
+// 7.18.2.5 Limits of greatest-width integer types
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+// 7.18.3 Limits of other integer types
+
+#ifdef _WIN64 // [
+# define PTRDIFF_MIN _I64_MIN
+# define PTRDIFF_MAX _I64_MAX
+#else // _WIN64 ][
+# define PTRDIFF_MIN _I32_MIN
+# define PTRDIFF_MAX _I32_MAX
+#endif // _WIN64 ]
+
+#define SIG_ATOMIC_MIN INT_MIN
+#define SIG_ATOMIC_MAX INT_MAX
+
+#ifndef SIZE_MAX // [
+# ifdef _WIN64 // [
+# define SIZE_MAX _UI64_MAX
+# else // _WIN64 ][
+# define SIZE_MAX _UI32_MAX
+# endif // _WIN64 ]
+#endif // SIZE_MAX ]
+
+// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
+#ifndef WCHAR_MIN // [
+# define WCHAR_MIN 0
+#endif // WCHAR_MIN ]
+#ifndef WCHAR_MAX // [
+# define WCHAR_MAX _UI16_MAX
+#endif // WCHAR_MAX ]
+
+#define WINT_MIN 0
+#define WINT_MAX _UI16_MAX
+
+#endif // __STDC_LIMIT_MACROS ]
+
+
+// 7.18.4 Limits of other integer types
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
+
+// 7.18.4.1 Macros for minimum-width integer constants
+
+#define INT8_C(val) val##i8
+#define INT16_C(val) val##i16
+#define INT32_C(val) val##i32
+#define INT64_C(val) val##i64
+
+#define UINT8_C(val) val##ui8
+#define UINT16_C(val) val##ui16
+#define UINT32_C(val) val##ui32
+#define UINT64_C(val) val##ui64
+
+// 7.18.4.2 Macros for greatest-width integer constants
+#define INTMAX_C INT64_C
+#define UINTMAX_C UINT64_C
+
+#endif // __STDC_CONSTANT_MACROS ]
+
+#endif // _MSC_STDINT_H_ ]
diff --git a/lib/wincompat.c b/lib/wincompat.c
new file mode 100644
index 0000000..8a243f9
--- /dev/null
+++ b/lib/wincompat.c
@@ -0,0 +1,61 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "wincompat.h"
+
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+ || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
+
+#include <errno.h>
+#include <io.h>
+
+int fsync(int fd)
+{
+ HANDLE h = (HANDLE)_get_osfhandle(fd);
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return(-1);
+ }
+
+ if(!FlushFileBuffers(h))
+ {
+ DWORD err = GetLastError();
+ switch(err)
+ {
+ case ERROR_ACCESS_DENIED:
+ return(0);
+
+ case ERROR_INVALID_HANDLE:
+ errno = EINVAL;
+ break;
+
+ default:
+ errno = EIO;
+ }
+ return(-1);
+ }
+
+ return(0);
+}
+
+#endif // WIN32 || WIN64
diff --git a/lib/wincompat.h b/lib/wincompat.h
new file mode 100644
index 0000000..5de29c3
--- /dev/null
+++ b/lib/wincompat.h
@@ -0,0 +1,118 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __wincompat_h
+#define __wincompat_h
+
+#include <limits.h>
+
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+ || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
+
+/* Prevent warnings about redefined malloc/free in generated code. */
+#ifndef _STDLIB_H
+#define _STDLIB_H
+#endif
+
+#include <malloc.h>
+
+#ifdef _MSC_VER
+#pragma warning (disable: 4996)
+#endif
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#define fileno _fileno
+
+#if _MSC_VER <= 1800
+#define snprintf _snprintf
+#endif
+
+#if !defined(__MINGW32__) && _MSC_VER < 1800
+#define atoll _atoi64
+#define strtoull _strtoui64
+#define strtoll _strtoi64
+#endif
+
+#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
+#endif
+
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+ || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) \
+ || defined(__MINGW32__))
+
+#define INT64_FMT "%I64d"
+#define UINT64_FMT "%I64u"
+
+#define INT64_HEX_FMT "%I64X"
+
+#define FILE_SEPARATOR "\\"
+
+#else /* defined(WIN32) || defined(__MINGW32__) */
+
+#define INT64_FMT "%lld"
+#define UINT64_FMT "%llu"
+
+#define INT64_HEX_FMT "%llX"
+
+#define FILE_SEPARATOR "/"
+
+#endif /* defined(WIN32) || defined(__MINGW32__) */
+
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
+ || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) \
+ && ! defined(__MINGW32__)
+
+#define INT64_CONST(I) (I ## i64)
+#define UINT64_CONST(I) (I ## Ui64)
+
+#ifndef INT_MAX
+#define INT_MAX (2147483647)
+#endif
+
+#ifndef INT_MIN
+#define INT_MIN (-2147483647-1)
+#endif
+
+#include <Shlwapi.h>
+#define IS_RELATIVE_PATH(P) \
+ (PathIsRelativeA(P))
+
+extern int fsync(int fd);
+
+#else /* defined(WIN32/WIN64) && ! defined(__MINGW32__) */
+
+#define INT64_CONST(I) (I ## LL)
+#define UINT64_CONST(I) (I ## ULL)
+
+#define IS_RELATIVE_PATH(P) \
+ ((P)[0] != '/')
+
+#include <unistd.h> /* for fsync() */
+
+#endif /* defined(WIN32/WIN64) && ! defined(__MINGW32__) */
+
+#endif /* __wincompat_h */
diff --git a/libconfig.spec.in b/libconfig.spec.in
new file mode 100644
index 0000000..b67f6a1
--- /dev/null
+++ b/libconfig.spec.in
@@ -0,0 +1,81 @@
+Name: @PACKAGE@
+Version: @VERSION@
+Release: 1
+Summary: C/C++ Configuration File Library
+
+Group: System Environment/Libraries
+License: LGPL
+URL: http://hyperrealm.com/main.php?s=libconfig
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n)
+
+Packager: Deneys S. Maartens <dsm@tlabs.ac.za>
+
+BuildRequires: texinfo
+
+%description
+%{name} is a simple library for processing structured configuration
+files. The file format is more compact and more readable than XML. And
+unlike XML, it is type-aware, so it is not necessary to do string
+parsing in application code. The library includes bindings for both
+the C and C++ languages. It works on POSIX-compliant UNIX systems.
+
+%package devel
+Summary: %{name} development package
+Group: Development/Libraries
+Requires: %{name} = %{version}
+
+%description devel
+Development files for %{name}.
+
+%prep
+%setup -q
+
+%build
+%configure
+make %{?_smp_mflags}
+make html
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+ldconfig
+
+%postun
+ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS COPYING.LIB ChangeLog INSTALL NEWS README
+%{_libdir}/%{name}.so*
+%{_libdir}/%{name}++.so*
+
+%files devel
+%defattr(-,root,root,-)
+%doc AUTHORS COPYING.LIB ChangeLog INSTALL NEWS README
+%doc doc/%{name}.html
+%doc test.cfg
+%doc examples/c/*.c
+%doc examples/c++/*.cpp
+%{_infodir}
+%{_includedir}
+%{_libdir}/pkgconfig
+%{_libdir}/cmake/libconfig
+%{_libdir}/cmake/libconfig++
+%{_libdir}/%{name}.a
+%{_libdir}/%{name}.la
+%{_libdir}/%{name}++.a
+%{_libdir}/%{name}++.la
+
+%changelog
+* Wed Oct 14 2015 Thomas Fischer <fischer@unix-ag.uni-kl.de> 1.5
+- added library directory cmake/libconfig and cmake/libconfig++
+* Wed Aug 19 2007 Deneys S. Maartens <dsm@tlabs.ac.za> 1.1.3-1
+- create spec file
+
+# -fin-
diff --git a/libconfig_vs2008.sln b/libconfig_vs2008.sln
new file mode 100644
index 0000000..3b855a8
--- /dev/null
+++ b/libconfig_vs2008.sln
@@ -0,0 +1,105 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_example1", "examples\c\example1.vcproj", "{454984C5-C302-4CE2-9B17-15B96E05E120}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2} = {1A234565-926D-49B2-83E4-D56E0C38C9F2}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "lib\libconfig.vcproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig++", "lib\libconfig++.vcproj", "{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_example2", "examples\c\example2.vcproj", "{E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2} = {1A234565-926D-49B2-83E4-D56E0C38C9F2}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_example3", "examples\c\example3.vcproj", "{93568409-C7AD-4A32-88E2-8883E10A8F7E}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2} = {1A234565-926D-49B2-83E4-D56E0C38C9F2}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example1", "examples\c++\cxx_example1.vcproj", "{A1DF518C-A515-45A3-9B67-7D49F616DECC}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE} = {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example2", "examples\c++\cxx_example2.vcproj", "{DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE} = {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example3", "examples\c++\cxx_example3.vcproj", "{8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE} = {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example4", "examples\c++\cxx_example4.vcproj", "{F631BE25-B384-4061-B7D1-E0C0E77D3A0C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE} = {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtinytest", "tinytest\tinytest.vcproj", "{58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig_tests", "tests\tests.vcproj", "{E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}"
+ ProjectSection(ProjectDependencies) = postProject
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA} = {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2} = {1A234565-926D-49B2-83E4-D56E0C38C9F2}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug|Win32.ActiveCfg = Debug|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug|Win32.Build.0 = Debug|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release|Win32.ActiveCfg = Release|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release|Win32.Build.0 = Release|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|Win32.Build.0 = Debug|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|Win32.ActiveCfg = Release|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|Win32.Build.0 = Release|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|Win32.Build.0 = Debug|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|Win32.ActiveCfg = Release|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|Win32.Build.0 = Release|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug|Win32.Build.0 = Debug|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release|Win32.ActiveCfg = Release|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release|Win32.Build.0 = Release|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug|Win32.Build.0 = Debug|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release|Win32.ActiveCfg = Release|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release|Win32.Build.0 = Release|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug|Win32.Build.0 = Debug|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release|Win32.ActiveCfg = Release|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release|Win32.Build.0 = Release|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug|Win32.Build.0 = Debug|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release|Win32.ActiveCfg = Release|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release|Win32.Build.0 = Release|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug|Win32.Build.0 = Debug|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release|Win32.ActiveCfg = Release|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release|Win32.Build.0 = Release|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug|Win32.Build.0 = Debug|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release|Win32.ActiveCfg = Release|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release|Win32.Build.0 = Release|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug|Win32.Build.0 = Debug|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release|Win32.ActiveCfg = Release|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release|Win32.Build.0 = Release|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug|Win32.Build.0 = Debug|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release|Win32.ActiveCfg = Release|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/libconfig_vs2017.sln b/libconfig_vs2017.sln
new file mode 100644
index 0000000..b62c5b4
--- /dev/null
+++ b/libconfig_vs2017.sln
@@ -0,0 +1,223 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27004.2005
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_example1", "examples\c\example1.vcxproj", "{454984C5-C302-4CE2-9B17-15B96E05E120}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "lib\libconfig.vcxproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig++", "lib\libconfig++.vcxproj", "{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_example2", "examples\c\example2.vcxproj", "{E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_example3", "examples\c\example3.vcxproj", "{93568409-C7AD-4A32-88E2-8883E10A8F7E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example1", "examples\c++\cxx_example1.vcxproj", "{A1DF518C-A515-45A3-9B67-7D49F616DECC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example2", "examples\c++\cxx_example2.vcxproj", "{DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example3", "examples\c++\cxx_example3.vcxproj", "{8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c++_example4", "examples\c++\cxx_example4.vcxproj", "{F631BE25-B384-4061-B7D1-E0C0E77D3A0C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtinytest", "tinytest\tinytest.vcxproj", "{58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig_tests", "tests\tests.vcxproj", "{E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug_Static|Win32 = Debug_Static|Win32
+ Debug_Static|x64 = Debug_Static|x64
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release_Static|Win32 = Release_Static|Win32
+ Release_Static|x64 = Release_Static|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug|Win32.ActiveCfg = Debug|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug|Win32.Build.0 = Debug|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug|x64.ActiveCfg = Debug|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Debug|x64.Build.0 = Debug|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release_Static|x64.Build.0 = Release_Static|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release|Win32.ActiveCfg = Release|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release|Win32.Build.0 = Release|Win32
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release|x64.ActiveCfg = Release|x64
+ {454984C5-C302-4CE2-9B17-15B96E05E120}.Release|x64.Build.0 = Release|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|Win32.Build.0 = Debug|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|x64.ActiveCfg = Debug|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|x64.Build.0 = Debug|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release_Static|x64.Build.0 = Release_Static|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|Win32.ActiveCfg = Release|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|Win32.Build.0 = Release|Win32
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|x64.ActiveCfg = Release|x64
+ {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|x64.Build.0 = Release|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|Win32.Build.0 = Debug|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|x64.ActiveCfg = Debug|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|x64.Build.0 = Debug|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release_Static|x64.Build.0 = Release_Static|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|Win32.ActiveCfg = Release|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|Win32.Build.0 = Release|Win32
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|x64.ActiveCfg = Release|x64
+ {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|x64.Build.0 = Release|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug|Win32.Build.0 = Debug|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug|x64.ActiveCfg = Debug|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Debug|x64.Build.0 = Debug|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release_Static|x64.Build.0 = Release_Static|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release|Win32.ActiveCfg = Release|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release|Win32.Build.0 = Release|Win32
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release|x64.ActiveCfg = Release|x64
+ {E4B1E9C1-E319-4A23-A6EB-85D74AB59BBE}.Release|x64.Build.0 = Release|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug|Win32.Build.0 = Debug|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug|x64.ActiveCfg = Debug|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Debug|x64.Build.0 = Debug|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release_Static|x64.Build.0 = Release_Static|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release|Win32.ActiveCfg = Release|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release|Win32.Build.0 = Release|Win32
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release|x64.ActiveCfg = Release|x64
+ {93568409-C7AD-4A32-88E2-8883E10A8F7E}.Release|x64.Build.0 = Release|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug|Win32.Build.0 = Debug|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug|x64.ActiveCfg = Debug|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Debug|x64.Build.0 = Debug|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release_Static|x64.Build.0 = Release_Static|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release|Win32.ActiveCfg = Release|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release|Win32.Build.0 = Release|Win32
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release|x64.ActiveCfg = Release|x64
+ {A1DF518C-A515-45A3-9B67-7D49F616DECC}.Release|x64.Build.0 = Release|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug|Win32.Build.0 = Debug|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug|x64.ActiveCfg = Debug|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Debug|x64.Build.0 = Debug|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release_Static|x64.Build.0 = Release_Static|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release|Win32.ActiveCfg = Release|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release|Win32.Build.0 = Release|Win32
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release|x64.ActiveCfg = Release|x64
+ {DEBD09F1-33A1-41A9-9506-BC3E6FD053FD}.Release|x64.Build.0 = Release|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug|Win32.Build.0 = Debug|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug|x64.ActiveCfg = Debug|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Debug|x64.Build.0 = Debug|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release_Static|x64.Build.0 = Release_Static|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release|Win32.ActiveCfg = Release|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release|Win32.Build.0 = Release|Win32
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release|x64.ActiveCfg = Release|x64
+ {8F2C54DE-BCC8-4CC7-81F3-FD0C04E8D5AE}.Release|x64.Build.0 = Release|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug|Win32.Build.0 = Debug|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug|x64.ActiveCfg = Debug|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Debug|x64.Build.0 = Debug|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release_Static|x64.Build.0 = Release_Static|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release|Win32.ActiveCfg = Release|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release|Win32.Build.0 = Release|Win32
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release|x64.ActiveCfg = Release|x64
+ {F631BE25-B384-4061-B7D1-E0C0E77D3A0C}.Release|x64.Build.0 = Release|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug|Win32.Build.0 = Debug|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug|x64.ActiveCfg = Debug|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Debug|x64.Build.0 = Debug|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release_Static|x64.Build.0 = Release_Static|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release|Win32.ActiveCfg = Release|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release|Win32.Build.0 = Release|Win32
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release|x64.ActiveCfg = Release|x64
+ {58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}.Release|x64.Build.0 = Release|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug_Static|Win32.ActiveCfg = Debug_Static|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug_Static|Win32.Build.0 = Debug_Static|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug_Static|x64.ActiveCfg = Debug_Static|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug_Static|x64.Build.0 = Debug_Static|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug|Win32.Build.0 = Debug|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug|x64.ActiveCfg = Debug|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Debug|x64.Build.0 = Debug|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release_Static|Win32.ActiveCfg = Release_Static|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release_Static|Win32.Build.0 = Release_Static|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release_Static|x64.ActiveCfg = Release_Static|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release_Static|x64.Build.0 = Release_Static|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release|Win32.ActiveCfg = Release|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release|Win32.Build.0 = Release|Win32
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release|x64.ActiveCfg = Release|x64
+ {E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {6E39C573-B7FB-4BDD-9BDC-416395EC6A68}
+ EndGlobalSection
+EndGlobal
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..44e0ecf
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,7982 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..5d9acd8
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..07a8602
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/test.cfg b/test.cfg
new file mode 100644
index 0000000..66a4fa9
--- /dev/null
+++ b/test.cfg
@@ -0,0 +1,82 @@
+#----------------------------
+# Example Configuration File
+#---------------------------
+#
+
+application:
+{
+
+ /* This section defines some settings for our
+ * main application window, such as size and
+ * position.
+ */
+
+ window:
+ {
+ title = "My Application";
+ size = { /* width */ w = 640; /* height */ h = 480; };
+ pos = { x = 350; y = 250; };
+ };
+
+ a = 5;
+ b = 6;
+ ff = 1E6;
+ test-comment = "/* hello\n \"there\"*/";
+
+ test-long-string = "A very long string that spans multiple lines. "
+ /* but wait, there's more... */ "Adjacent strings are automatically"
+ " concatenated.";
+
+ test-escaped-string = "\"This is\n a test.\"";
+
+ group1:
+ {
+ x = 5; y = 10;
+ my_array = [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 ];
+ flag = TRUE;
+
+ group2: { zzz = "this is a test"; };
+
+ states = [ "CT", // Connecticut
+ "CA", // California
+ "TX", // Texas
+ "NV", // Nevada
+ "FL" // Florida
+ ];
+ };
+
+ /* this would cause an error */
+ // a = "hi!";
+};
+
+binary = [ 0xAA, 0xBB, 0xCC ];
+
+list = ( ( "abc", 123, true ), 1.234, ( /* an empty list */ ) ,[ 1, 2, 3 ],
+ { a = (1, 2, true); } );
+
+books = ( "inventory",
+ { title = "Treasure Island";
+ author = "Robert Louis Stevenson";
+ price = 29.99;
+ qty = 5; },
+ { title = "Snow Crash";
+ author = "Neal Stephenson";
+ price = 9.99;
+ qty = 8; },
+ { } );
+
+# miscellaneous stuff
+
+misc:
+{
+ port = 5000;
+ pi = 3.14159265;
+ enabled = FALSE;
+ mask = 0xAABBCCDD;
+ unicode = "STARGΛ̊TE SG-1"; // UTF-8 string
+ bigint = 9223372036854775807L;
+ bighex = 0x1122334455667788L;
+};
+
+
+### eof
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..a0e7e89
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,22 @@
+if(CMAKE_HOST_WIN32)
+ set(libname "libconfig")
+else()
+ set(libname "config")
+endif()
+
+include_directories(${CMAKE_SOURCE_DIR}/lib)
+
+add_executable(libconfig_tests
+ tests.c
+)
+
+target_link_libraries(libconfig_tests
+ ${libname}
+ libtinytest
+)
+
+add_test(
+ NAME libconfig_tests
+ COMMAND libconfig_tests
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..2a099c6
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,18 @@
+
+check_PROGRAMS = libconfig_tests
+noinst_PROGRAMS=$(check_PROGRAMS)
+TESTS = $(check_PROGRAMS)
+
+libconfig_tests_SOURCES = tests.c
+
+libconfig_tests_CPPFLAGS = -I$(top_srcdir)/tinytest -I$(top_srcdir)/lib
+
+libconfig_tests_LDADD = -L$(top_builddir)/tinytest -ltinytest \
+ -L$(top_builddir)/lib/.libs -lconfig
+
+
+EXTRA_DIST = \
+ tests.vcproj \
+ tests.vcxproj \
+ testdata/*.cfg \
+ testdata/*.txt
diff --git a/tests/testdata/bad_input_0.cfg b/tests/testdata/bad_input_0.cfg
new file mode 100644
index 0000000..587be6b
--- /dev/null
+++ b/tests/testdata/bad_input_0.cfg
@@ -0,0 +1 @@
+x
diff --git a/tests/testdata/bad_input_1.cfg b/tests/testdata/bad_input_1.cfg
new file mode 100644
index 0000000..ee788b6
--- /dev/null
+++ b/tests/testdata/bad_input_1.cfg
@@ -0,0 +1,7 @@
+
+foo:
+{
+ a = 100;
+ b = 10;
+ a = "hello";
+};
diff --git a/tests/testdata/input_0.cfg b/tests/testdata/input_0.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/testdata/input_0.cfg
diff --git a/tests/testdata/input_1.cfg b/tests/testdata/input_1.cfg
new file mode 100644
index 0000000..131bb5e
--- /dev/null
+++ b/tests/testdata/input_1.cfg
@@ -0,0 +1,3 @@
+// Empty file
+
+// (no settings, only comments)
diff --git a/tests/testdata/input_2.cfg b/tests/testdata/input_2.cfg
new file mode 100644
index 0000000..e342dca
--- /dev/null
+++ b/tests/testdata/input_2.cfg
@@ -0,0 +1,18 @@
+
+// File with extraneous whitespace.
+
+ foo = 1;
+
+
+
+ bar
+ =
+ "Hello, "
+ "world!"
+;
+
+
+baz = 2;
+
+
+
diff --git a/tests/testdata/input_3.cfg b/tests/testdata/input_3.cfg
new file mode 100644
index 0000000..ce71ad6
--- /dev/null
+++ b/tests/testdata/input_3.cfg
@@ -0,0 +1,7 @@
+// File has no trailing newline.
+
+foo = 1;
+
+bar = 2;
+
+baz = 3; \ No newline at end of file
diff --git a/tests/testdata/input_4.cfg b/tests/testdata/input_4.cfg
new file mode 100644
index 0000000..f803875
--- /dev/null
+++ b/tests/testdata/input_4.cfg
@@ -0,0 +1,8 @@
+// Last line has whitespace but no trailing newline.
+
+foo = 1;
+
+
+bar = 2;
+
+ \ No newline at end of file
diff --git a/tests/testdata/input_5.cfg b/tests/testdata/input_5.cfg
new file mode 100644
index 0000000..777a424
--- /dev/null
+++ b/tests/testdata/input_5.cfg
@@ -0,0 +1 @@
+@include "more.cfg"
diff --git a/tests/testdata/input_6.cfg b/tests/testdata/input_6.cfg
new file mode 100644
index 0000000..9763386
--- /dev/null
+++ b/tests/testdata/input_6.cfg
@@ -0,0 +1,5 @@
+// Empty file
+
+// (no settings, only comments)
+
+# .. and no new line character at the end \ No newline at end of file
diff --git a/tests/testdata/more.cfg b/tests/testdata/more.cfg
new file mode 100644
index 0000000..dad36e1
--- /dev/null
+++ b/tests/testdata/more.cfg
@@ -0,0 +1,2 @@
+
+message = "Hello, world!";
diff --git a/tests/testdata/output_0.cfg b/tests/testdata/output_0.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/testdata/output_0.cfg
diff --git a/tests/testdata/output_1.cfg b/tests/testdata/output_1.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/testdata/output_1.cfg
diff --git a/tests/testdata/output_2.cfg b/tests/testdata/output_2.cfg
new file mode 100644
index 0000000..80db4ae
--- /dev/null
+++ b/tests/testdata/output_2.cfg
@@ -0,0 +1,3 @@
+foo = 1;
+bar = "Hello, world!";
+baz = 2;
diff --git a/tests/testdata/output_3.cfg b/tests/testdata/output_3.cfg
new file mode 100644
index 0000000..6a3d003
--- /dev/null
+++ b/tests/testdata/output_3.cfg
@@ -0,0 +1,3 @@
+foo = 1;
+bar = 2;
+baz = 3;
diff --git a/tests/testdata/output_4.cfg b/tests/testdata/output_4.cfg
new file mode 100644
index 0000000..78abe90
--- /dev/null
+++ b/tests/testdata/output_4.cfg
@@ -0,0 +1,2 @@
+foo = 1;
+bar = 2;
diff --git a/tests/testdata/output_5.cfg b/tests/testdata/output_5.cfg
new file mode 100644
index 0000000..25817c4
--- /dev/null
+++ b/tests/testdata/output_5.cfg
@@ -0,0 +1 @@
+message = "Hello, world!";
diff --git a/tests/testdata/output_6.cfg b/tests/testdata/output_6.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/testdata/output_6.cfg
diff --git a/tests/testdata/override_setting.cfg b/tests/testdata/override_setting.cfg
new file mode 100644
index 0000000..c537c92
--- /dev/null
+++ b/tests/testdata/override_setting.cfg
@@ -0,0 +1,20 @@
+group:
+{
+ @include "more.cfg"
+ message = "overridden";
+ array = (1,2);
+ array = (3);
+ inner = {
+ name = "value";
+ none = "none";
+ };
+ inner = {
+ name = "other-value";
+ name = "overridden";
+ other = "other";
+ };
+};
+int = 1;
+int = 2;
+string = "value";
+string = "overridden";
diff --git a/tests/testdata/parse_error_0.txt b/tests/testdata/parse_error_0.txt
new file mode 100644
index 0000000..dd4f68c
--- /dev/null
+++ b/tests/testdata/parse_error_0.txt
@@ -0,0 +1 @@
+2 syntax error
diff --git a/tests/testdata/parse_error_1.txt b/tests/testdata/parse_error_1.txt
new file mode 100644
index 0000000..ce70b88
--- /dev/null
+++ b/tests/testdata/parse_error_1.txt
@@ -0,0 +1 @@
+6 duplicate setting name
diff --git a/tests/testdata/strings.cfg b/tests/testdata/strings.cfg
new file mode 100644
index 0000000..cca9afd
--- /dev/null
+++ b/tests/testdata/strings.cfg
@@ -0,0 +1,10 @@
+escape_seqs:
+{
+ str = "abc";
+ newline = "abc\ndef\n";
+ cr = "abc\rdef\r";
+ tab = "abc\tdef\t";
+ feed = "abc\fdef\f";
+ backslash = "abc\\def\\";
+ dquote = "abc\"def\"";
+};
diff --git a/tests/tests.c b/tests/tests.c
new file mode 100644
index 0000000..c12a0c6
--- /dev/null
+++ b/tests/tests.c
@@ -0,0 +1,574 @@
+/* ----------------------------------------------------------------------------
+ libconfig - A library for processing structured configuration files
+ Copyright (C) 2005-2018 Mark A Lindner
+
+ This file is part of libconfig.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+#include <libconfig.h>
+#include <tinytest.h>
+
+/* ------------------------------------------------------------------------- */
+
+static void parse_and_compare(const char *input_file, const char *output_file)
+{
+ config_t cfg;
+ int ok;
+
+ config_init(&cfg);
+ config_set_include_dir(&cfg, "./testdata");
+
+ ok = config_read_file(&cfg, input_file);
+ if(!ok)
+ {
+ printf("error: %s:%d\n", config_error_text(&cfg),
+ config_error_line(&cfg));
+ }
+ TT_ASSERT_TRUE(ok);
+
+ remove("temp.cfg");
+ TT_ASSERT_TRUE(config_write_file(&cfg, "temp.cfg"));
+
+ TT_ASSERT_TXTFILE_EQ("temp.cfg", output_file);
+ remove("temp.cfg");
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void parse_file_and_compare_error(const char *input_file,
+ const char *parse_error)
+{
+ config_t cfg;
+ char actual_error[128];
+ char expected_error[128];
+
+ config_init(&cfg);
+ TT_ASSERT_FALSE(config_read_file(&cfg, input_file));
+
+ snprintf(expected_error, sizeof(expected_error), "%s:%s",
+ input_file, parse_error);
+
+ snprintf(actual_error, sizeof(actual_error), "%s:%d %s\n",
+ config_error_file(&cfg), config_error_line(&cfg),
+ config_error_text(&cfg));
+
+ config_destroy(&cfg);
+
+ TT_ASSERT_STR_EQ(actual_error, expected_error);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static void parse_string_and_compare_error(const char *input_text,
+ const char *parse_error)
+{
+ config_t cfg;
+ char actual_error[128];
+ char expected_error[128];
+
+ config_init(&cfg);
+ TT_ASSERT_FALSE(config_read_string(&cfg, input_text));
+
+ snprintf(expected_error, sizeof(expected_error), "(null):%s", parse_error);
+
+ snprintf(actual_error, sizeof(actual_error), "%s:%d %s\n",
+ config_error_file(&cfg), config_error_line(&cfg),
+ config_error_text(&cfg));
+
+ config_destroy(&cfg);
+
+ TT_ASSERT_STR_EQ(actual_error, expected_error);
+}
+
+/* ------------------------------------------------------------------------- */
+
+static const char *read_file_to_string(const char *file)
+{
+ struct stat stbuf;
+ FILE *fp;
+ int size;
+ char *buf;
+ size_t r;
+
+ TT_ASSERT_INT_EQ(0, stat(file, &stbuf));
+
+ size = stbuf.st_size;
+ buf = (char *)malloc(size + 1);
+ TT_ASSERT_PTR_NOTNULL(buf);
+
+ fp = fopen(file, "rt");
+ TT_ASSERT_PTR_NOTNULL(fp);
+
+ r = fread(buf, 1, size, fp);
+ fclose(fp);
+
+ TT_ASSERT_INT_EQ(size, r);
+
+ *(buf + size) = 0;
+ return(buf);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(ParsingAndFormatting)
+{
+ int i;
+
+ for(i = 0;; ++i)
+ {
+ char input_file[128], output_file[128];
+ sprintf(input_file, "testdata/input_%d.cfg", i);
+ sprintf(output_file, "testdata/output_%d.cfg", i);
+ printf("parsing %s\n", input_file);
+
+ if(!tt_file_exists(input_file) || !tt_file_exists(output_file))
+ break;
+
+ parse_and_compare(input_file, output_file);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(ParseInvalidFiles)
+{
+ int i;
+
+ for(i = 0;; ++i)
+ {
+ char input_file[128], error_file[128];
+ char error_text[128];
+ FILE *fp;
+
+ sprintf(input_file, "testdata/bad_input_%d.cfg", i);
+ sprintf(error_file, "testdata/parse_error_%d.txt", i);
+
+ if(!tt_file_exists(input_file) || !tt_file_exists(error_file))
+ break;
+
+ fp = fopen(error_file, "rt");
+ TT_ASSERT_PTR_NOTNULL(fp);
+ TT_ASSERT_PTR_NOTNULL(fgets(error_text, sizeof(error_text), fp));
+ fclose(fp);
+
+ parse_file_and_compare_error(input_file, error_text);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(ParseInvalidStrings)
+{
+ int i;
+
+ for(i = 0;; ++i)
+ {
+ char input_file[128], error_file[128];
+ const char *input_text;
+ char error_text[128];
+ FILE *fp;
+
+ sprintf(input_file, "testdata/bad_input_%d.cfg", i);
+ sprintf(error_file, "testdata/parse_error_%d.txt", i);
+
+ if(!tt_file_exists(input_file) || !tt_file_exists(error_file))
+ break;
+
+ input_text = read_file_to_string(input_file);
+
+ fp = fopen(error_file, "rt");
+ TT_ASSERT_PTR_NOTNULL(fp);
+ TT_ASSERT_PTR_NOTNULL(fgets(error_text, sizeof(error_text), fp));
+ fclose(fp);
+
+ parse_string_and_compare_error(input_text, error_text);
+
+ free((void *)input_text);
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt1)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival;
+ long long llval;
+
+ buf = "someint=5;";
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT_EQ(ival, 5);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT_EQ(llval, 5);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt2)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival = 123;
+ long long llval;
+
+ buf = "someint=8589934592;"; /* 2^33 */
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ /* Should fail because value was parsed as an int64. */
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_FALSE(rc);
+ TT_ASSERT_INT_EQ(ival, 123);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT64_EQ(llval, 8589934592LL);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt3)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival = 123;
+ long long llval;
+
+ buf = "someint=-8589934592;"; /* -2^33 */
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ /* Should fail because value was parsed as an int64. */
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_FALSE(rc);
+ TT_ASSERT_INT_EQ(ival, 123);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT64_EQ(llval, -8589934592LL);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt4)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival = 123;
+ long long llval;
+
+ buf = "someint=2147483647;"; /* 2^31-1 */
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT_EQ(ival, 2147483647);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT64_EQ(llval, 2147483647LL);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt5)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival = 123;
+ long long llval;
+
+ buf = "someint=2147483648;"; /* 2^31 */
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ /* Should fail because value was parsed as an int64. */
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_FALSE(rc);
+ TT_ASSERT_INT_EQ(ival, 123);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT64_EQ(llval, 2147483648LL);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt6)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival;
+ long long llval;
+
+ buf = "someint=-2147483648;"; /* -2^31 */
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT_EQ(ival, -2147483648LL);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT64_EQ(llval, -2147483648LL);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(BigInt7)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ int ival = 123;
+ long long llval;
+
+ buf = "someint=-2147483649;"; /* -2^31-1 */
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ /* Should fail because value was parsed as an int64. */
+ rc = config_lookup_int(&cfg, "someint", &ival);
+ TT_ASSERT_FALSE(rc);
+ TT_ASSERT_INT_EQ(ival, 123);
+
+ rc = config_lookup_int64(&cfg, "someint", &llval);
+ TT_ASSERT_TRUE(rc);
+ TT_ASSERT_INT64_EQ(llval, -2147483649LL);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(RemoveSetting)
+{
+ char *buf;
+ config_t cfg;
+ int rc;
+ config_setting_t* rootSetting;
+
+ buf = "a:{b:3;c:4;}";
+
+ config_init(&cfg);
+ rc = config_read_string(&cfg, buf);
+ TT_ASSERT_TRUE(rc);
+
+ rootSetting = config_root_setting(&cfg);
+ rc = config_setting_remove(rootSetting, "a.c");
+ TT_ASSERT_TRUE(rc);
+
+ /* a and a.b are found */
+ rootSetting = config_lookup(&cfg, "a");
+ TT_EXPECT_PTR_NOTNULL(rootSetting);
+ rootSetting = config_lookup(&cfg, "a.b");
+ TT_EXPECT_PTR_NOTNULL(rootSetting);
+ rootSetting = config_lookup(&cfg, "a.c");
+ TT_EXPECT_PTR_NULL(rootSetting);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(EscapedStrings)
+{
+ config_t cfg;
+ int ok;
+ const char *str;
+
+ config_init(&cfg);
+ config_set_include_dir(&cfg, "./testdata");
+
+ ok = config_read_file(&cfg, "testdata/strings.cfg");
+ if(!ok)
+ {
+ printf("error: %s:%d\n", config_error_text(&cfg),
+ config_error_line(&cfg));
+ }
+ TT_ASSERT_TRUE(ok);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.str", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc", str);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.newline", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc\ndef\n", str);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.cr", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc\rdef\r", str);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.tab", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc\tdef\t", str);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.feed", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc\fdef\f", str);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.backslash", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc\\def\\", str);
+
+ ok = config_lookup_string(&cfg, "escape_seqs.dquote", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("abc\"def\"", str);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+TT_TEST(OverrideSetting)
+{
+ config_t cfg;
+ int ok;
+ int ival;
+ const char *str;
+
+ config_init(&cfg);
+ config_set_options(&cfg, CONFIG_OPTION_ALLOW_OVERRIDES);
+ config_set_include_dir(&cfg, "./testdata");
+
+ ok = config_read_file(&cfg, "testdata/override_setting.cfg");
+ if(!ok)
+ {
+ printf("error: %s:%d\n", config_error_text(&cfg),
+ config_error_line(&cfg));
+ }
+ TT_ASSERT_TRUE(ok);
+
+ ok = config_lookup_string(&cfg, "group.message", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("overridden", str);
+
+ ok = config_lookup_string(&cfg, "group.inner.name", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("overridden", str);
+
+ ok = config_lookup_string(&cfg, "group.inner.other", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("other", str);
+
+ ok = config_lookup_string(&cfg, "group.inner.none", &str);
+ TT_ASSERT_FALSE(ok);
+
+ ok = config_lookup_string(&cfg, "group.inner.other", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("other", str);
+
+ ok = config_lookup_string(&cfg, "string", &str);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_STR_EQ("overridden", str);
+
+ ok = config_lookup_int(&cfg, "int", &ival);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_INT_EQ(ival, 2);
+
+ ok = config_lookup_int(&cfg, "group.array.[0]", &ival);
+ TT_ASSERT_TRUE(ok);
+ TT_ASSERT_INT_EQ(ival, 3);
+
+ ok = config_lookup_int(&cfg, "group.array.[1]", &ival);
+ TT_ASSERT_FALSE(ok);
+
+ config_destroy(&cfg);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int main(int argc, char **argv)
+{
+ int failures;
+
+ TT_SUITE_START(LibConfigTests);
+ TT_SUITE_TEST(LibConfigTests, ParsingAndFormatting);
+ TT_SUITE_TEST(LibConfigTests, ParseInvalidFiles);
+ TT_SUITE_TEST(LibConfigTests, ParseInvalidStrings);
+ TT_SUITE_TEST(LibConfigTests, BigInt1);
+ TT_SUITE_TEST(LibConfigTests, BigInt2);
+ TT_SUITE_TEST(LibConfigTests, BigInt3);
+ TT_SUITE_TEST(LibConfigTests, BigInt4);
+ TT_SUITE_TEST(LibConfigTests, BigInt5);
+ TT_SUITE_TEST(LibConfigTests, BigInt6);
+ TT_SUITE_TEST(LibConfigTests, BigInt7);
+ TT_SUITE_TEST(LibConfigTests, RemoveSetting);
+ TT_SUITE_TEST(LibConfigTests, EscapedStrings);
+ TT_SUITE_TEST(LibConfigTests, OverrideSetting);
+ TT_SUITE_RUN(LibConfigTests);
+ failures = TT_SUITE_NUM_FAILURES(LibConfigTests);
+ TT_SUITE_END(LibConfigTests);
+
+ if (failures)
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
+}
diff --git a/tests/tests.vcproj b/tests/tests.vcproj
new file mode 100644
index 0000000..545caef
--- /dev/null
+++ b/tests/tests.vcproj
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libconfig_tests"
+ ProjectGUID="{E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}"
+ RootNamespace="libconfig_tests"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../lib;../tinytest"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ RuntimeLibrary="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName).$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../lib;../tinytest"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\tests.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ </Filter>
+ <Filter
+ Name="Data Files"
+ >
+ <File
+ RelativePath=".\testdata\bad_input_0.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\bad_input_1.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\input_0.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\input_1.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\input_2.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\input_3.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\input_4.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\output_0.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\output_1.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\output_2.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\output_3.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\output_4.cfg"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\parse_error_0.txt"
+ >
+ </File>
+ <File
+ RelativePath=".\testdata\parse_error_1.txt"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/tests/tests.vcxproj b/tests/tests.vcxproj
new file mode 100644
index 0000000..dca5060
--- /dev/null
+++ b/tests/tests.vcxproj
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>libconfig_tests</ProjectName>
+ <ProjectGuid>{E4FF1E84-9D5A-4A45-A5E5-8B99CA895172}</ProjectGuid>
+ <RootNamespace>libconfig_tests</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;LIBCONFIG_STATIC;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;LIBCONFIG_STATIC;WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <CompileAs>CompileAsC</CompileAs>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;LIBCONFIG_STATIC;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../lib;../tinytest;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>LIBCONFIGXX_STATIC;LIBCONFIG_STATIC;WIN64;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="tests.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="testdata\bad_input_0.cfg" />
+ <None Include="testdata\bad_input_1.cfg" />
+ <None Include="testdata\input_0.cfg" />
+ <None Include="testdata\input_1.cfg" />
+ <None Include="testdata\input_2.cfg" />
+ <None Include="testdata\input_3.cfg" />
+ <None Include="testdata\input_4.cfg" />
+ <None Include="testdata\output_0.cfg" />
+ <None Include="testdata\output_1.cfg" />
+ <None Include="testdata\output_2.cfg" />
+ <None Include="testdata\output_3.cfg" />
+ <None Include="testdata\output_4.cfg" />
+ <None Include="testdata\parse_error_0.txt" />
+ <None Include="testdata\parse_error_1.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\lib\libconfig.vcxproj">
+ <Project>{1a234565-926d-49b2-83e4-d56e0c38c9f2}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\tinytest\tinytest.vcxproj">
+ <Project>{58f43d41-fe56-40e1-bb83-9cb8cde0b7aa}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/tests/tests.vcxproj.filters b/tests/tests.vcxproj.filters
new file mode 100644
index 0000000..8964a95
--- /dev/null
+++ b/tests/tests.vcxproj.filters
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{b79fd02f-2ff5-4e09-9079-46978369327c}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{2a17aaac-682f-4305-a6ce-30bbc44247fe}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Data Files">
+ <UniqueIdentifier>{ea1c6038-dca9-421d-81fb-5bd9e51167c5}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="tests.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="testdata\bad_input_0.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\bad_input_1.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\input_0.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\input_1.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\input_2.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\input_3.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\input_4.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\output_0.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\output_1.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\output_2.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\output_3.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\output_4.cfg">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\parse_error_0.txt">
+ <Filter>Data Files</Filter>
+ </None>
+ <None Include="testdata\parse_error_1.txt">
+ <Filter>Data Files</Filter>
+ </None>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/tinytest/CMakeLists.txt b/tinytest/CMakeLists.txt
new file mode 100644
index 0000000..3896e66
--- /dev/null
+++ b/tinytest/CMakeLists.txt
@@ -0,0 +1,17 @@
+add_library(libtinytest STATIC
+ tinytest.c tinytest.h)
+
+target_include_directories(libtinytest
+ PUBLIC
+ $<INSTALL_INTERFACE:.>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+)
+
+if(CMAKE_HOST_WIN32)
+ if(MSVC)
+ set_target_properties(libtinytest
+ PROPERTIES
+ COMPILE_FLAGS "/wd4996"
+ )
+ endif()
+endif()
diff --git a/tinytest/Makefile.am b/tinytest/Makefile.am
new file mode 100644
index 0000000..443132c
--- /dev/null
+++ b/tinytest/Makefile.am
@@ -0,0 +1,6 @@
+
+noinst_LIBRARIES = libtinytest.a
+
+libtinytest_a_SOURCES = tinytest.c tinytest.h
+
+EXTRA_DIST = tinytest.vcproj tinytest.vcxproj
diff --git a/tinytest/tinytest.c b/tinytest/tinytest.c
new file mode 100644
index 0000000..499f1e9
--- /dev/null
+++ b/tinytest/tinytest.c
@@ -0,0 +1,730 @@
+/* ----------------------------------------------------------------------------
+ tinytest - A tiny C unit-testing library
+ Copyright (C) 2010-2018 Mark A Lindner
+
+ This file is part of tinytest.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#include "tinytest.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#ifdef WIN32
+#include <io.h>
+#define F_OK 4 // Windows doesn't have F_OK
+#else
+#include <unistd.h>
+#endif
+
+/*
+ */
+
+static tt_testsuite_t *__tt_current_suite = NULL;
+
+static const char *__tt_op_strings[] = { "==", "!=", "<", "<=", ">", ">=",
+ "==", "!=", "<", "<=", ">", ">=",
+ "==", "!=", "<", "<=", ">", ">=",
+ "==", "!=", "<", "<=", ">", ">=",
+ "==", "!=", "<", "<=", ">", ">=",
+ "==", "!=", "<", "<=", ">", ">=",
+ "==", "!=", "", "!",
+ "==file", "!=file",
+ "==txtfile", "!=txtfile" };
+
+/*
+ */
+
+static tt_bool_t __tt_chop(char *s)
+{
+ size_t len = strlen(s);
+ char *p;
+ tt_bool_t eol = TT_FALSE;
+
+ for(p = s + len - 1; p > s; --p) {
+ if ((*p == '\r') || (*p == '\n')) {
+ eol = TT_TRUE;
+ *p = 0;
+ }
+ }
+
+ return(eol);
+}
+
+static tt_bool_t __tt_compare_files_text(const char *file1, const char *file2,
+ tt_bool_t verbose)
+{
+ FILE *fp1, *fp2;
+ char buf1[4096], buf2[4096];
+ int line = 1;
+ int character = 0;
+ tt_bool_t matched = TT_TRUE, eof1, eof2;
+
+ if(!(fp1 = fopen(file1, "rt")))
+ {
+ printf("cannot open file: %s\n", file1);
+ return(TT_FALSE);
+ }
+
+ if(!(fp2 = fopen(file2, "rt")))
+ {
+ fclose(fp1);
+ printf("cannot open file: %s\n", file2);
+ return(TT_FALSE);
+ }
+
+ for(;;)
+ {
+ char *r1, *r2, *p, *q;
+
+ r1 = fgets(buf1, sizeof(buf1), fp1);
+ r2 = fgets(buf2, sizeof(buf2), fp2);
+
+ if((r1 == NULL) || (r2 == NULL))
+ {
+ matched = (r1 == r2) ? TT_TRUE : TT_FALSE;
+ break;
+ }
+
+ eof1 = __tt_chop(r1);
+ eof2 = __tt_chop(r2);
+
+ p = r1;
+ q = r2;
+
+ while(*p && *q)
+ {
+ if(*p != *q)
+ {
+ matched = TT_FALSE;
+ break;
+ }
+
+ ++character;
+ ++p;
+ ++q;
+ }
+
+ if(eof1 != eof2)
+ matched = TT_FALSE;
+
+ if(matched == TT_FALSE)
+ break;
+
+ if(eof1 && eof2)
+ {
+ ++line;
+ character = 0;
+ }
+ }
+
+ fclose(fp1);
+ fclose(fp2);
+
+ if(!matched && verbose)
+ printf("files \"%s\" and \"%s\" differ starting at line %d, char %d\n",
+ file1, file2, line, character);
+
+ return(matched);
+}
+
+static tt_bool_t __tt_compare_files(const char *file1, const char *file2,
+ tt_bool_t verbose)
+{
+ FILE *fp1, *fp2;
+ char buf1[4096], buf2[4096];
+ int line = 1;
+ int character = 0;
+ size_t r1, r2;
+ tt_bool_t done = TT_FALSE, matched = TT_TRUE;
+
+ if(!(fp1 = fopen(file1, "rb")))
+ {
+ printf("cannot open file: %s\n", file1);
+ return(TT_FALSE);
+ }
+
+ if(!(fp2 = fopen(file2, "rb")))
+ {
+ fclose(fp1);
+ printf("cannot open file: %s\n", file2);
+ return(TT_FALSE);
+ }
+
+ while(!done)
+ {
+ char *p, *q, *pe, *qe;
+
+ r1 = fread(buf1, 1, sizeof(buf1), fp1);
+ r2 = fread(buf2, 1, sizeof(buf2), fp2);
+
+ p = buf1;
+ q = buf2;
+ pe = buf1 + r1;
+ qe = buf2 + r2;
+
+ while(p < pe && q < qe)
+ {
+ if(*p != *q)
+ {
+ matched = TT_FALSE;
+ done = TT_TRUE;
+ break;
+ }
+
+ if(*p == '\n')
+ {
+ ++line;
+ character = 0;
+ }
+ else
+ ++character;
+
+ ++p;
+ ++q;
+ }
+
+ if(p < pe || q < qe)
+ {
+ matched = TT_FALSE;
+ break;
+ }
+
+ if(feof(fp1) || feof(fp2))
+ break;
+ }
+
+ fclose(fp1);
+ fclose(fp2);
+
+ if(!matched && verbose)
+ printf("files \"%s\" and \"%s\" differ starting at line %d, char %d\n",
+ file1, file2, line, character);
+
+ return(matched);
+}
+
+/*
+ */
+
+tt_testsuite_t *tt_suite_create(const char *name)
+{
+ tt_testsuite_t *suite = calloc(1, sizeof(tt_testsuite_t));
+ suite->name = strdup(name);
+ return(suite);
+}
+
+/*
+ */
+
+void tt_suite_destroy(tt_testsuite_t *suite)
+{
+ tt_test_t *test = suite->first_test;
+
+ while(test)
+ {
+ tt_test_t *tmp = test->next;
+ free((void *)test->name);
+ free(test);
+ test = tmp;
+ }
+
+ free((void *)suite->name);
+ free(suite);
+}
+
+/*
+ */
+
+void tt_suite_add_test(tt_testsuite_t *suite, const char *name,
+ void (*function)(void))
+{
+ tt_test_t *test = calloc(1, sizeof(tt_test_t));
+ test->name = strdup(name);
+ test->function = function;
+
+ if(suite->last_test != NULL)
+ suite->last_test->next = test;
+
+ suite->last_test = test;
+
+ if(suite->first_test == NULL)
+ suite->first_test = test;
+
+ ++suite->num_tests;
+}
+
+/*
+ */
+
+void tt_suite_run(tt_testsuite_t *suite)
+{
+ __tt_current_suite = suite;
+
+ suite->num_failures = 0;
+
+ for(suite->current_test = suite->first_test;
+ suite->current_test;
+ suite->current_test = suite->current_test->next)
+ {
+ printf("[TEST] %s\n", suite->current_test->name);
+
+ if(setjmp(suite->jump_buf) == 0)
+ {
+ suite->current_test->function();
+ }
+
+ if(suite->current_test->failed)
+ {
+ printf("[FAIL] %s\n", suite->current_test->name);
+ ++suite->num_failures;
+ }
+ else
+ {
+ printf("[ OK ] %s\n", suite->current_test->name);
+ }
+ }
+
+ if(suite->num_failures > 0)
+ puts("*** FAILURES! ***");
+
+ printf("%d tests; %d passed, %d failed\n",
+ suite->num_tests, suite->num_tests - suite->num_failures,
+ suite->num_failures);
+
+ suite->current_test = NULL;
+ __tt_current_suite = NULL;
+}
+
+/*
+ */
+
+void tt_output_val(FILE *stream, const tt_val_t *val)
+{
+ switch(val->type)
+ {
+ case TT_VAL_INT:
+ fprintf(stream, "%d", val->value.int_val);
+ break;
+
+ case TT_VAL_UINT:
+ fprintf(stream, "%u", val->value.uint_val);
+ break;
+
+ case TT_VAL_INT64:
+ fprintf(stream, "%lld", val->value.int64_val);
+ break;
+
+ case TT_VAL_UINT64:
+ fprintf(stream, "%llu", val->value.uint64_val);
+ break;
+
+ case TT_VAL_DOUBLE:
+ fprintf(stream, "%f", val->value.double_val);
+ break;
+
+ case TT_VAL_STR:
+ {
+ const char *p;
+
+ fputc('\"', stream);
+ for(p = val->value.str_val; *p; ++p)
+ {
+ if(*p == '\n')
+ fputs("\\n", stream);
+ else if(*p == '\r')
+ fputs("\\r", stream);
+ else if(*p == '\t')
+ fputs("\\t", stream);
+ else if(*p == '\f')
+ fputs("\\f", stream);
+ else if(*p < ' ')
+ fprintf(stream, "\\0x%02X", *p);
+ else
+ fputc(*p, stream);
+ }
+ fputc('\"', stream);
+ break;
+ }
+
+ case TT_VAL_PTR:
+ fprintf(stream, "%p", val->value.ptr_val);
+ break;
+
+ default:
+ fputs("???", stream);
+ break;
+ }
+}
+
+/*
+ */
+
+void tt_expect(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, const tt_val_t a,
+ const tt_val_t b, tt_bool_t fatal)
+{
+ tt_bool_t result = TT_FALSE;
+
+ switch(op)
+ {
+ case TT_OP_INT_EQ:
+ result = (a.value.int_val == b.value.int_val);
+ break;
+
+ case TT_OP_INT_NE:
+ result = (a.value.int_val != b.value.int_val);
+ break;
+
+ case TT_OP_INT_LT:
+ result = (a.value.int_val < b.value.int_val);
+ break;
+
+ case TT_OP_INT_LE:
+ result = (a.value.int_val <= b.value.int_val);
+ break;
+
+ case TT_OP_INT_GT:
+ result = (a.value.int_val > b.value.int_val);
+ break;
+
+ case TT_OP_INT_GE:
+ result = (a.value.int_val >= b.value.int_val);
+ break;
+
+ case TT_OP_UINT_EQ:
+ result = (a.value.uint_val == b.value.uint_val);
+ break;
+
+ case TT_OP_UINT_NE:
+ result = (a.value.uint_val != b.value.uint_val);
+ break;
+
+ case TT_OP_UINT_LT:
+ result = (a.value.uint_val < b.value.uint_val);
+ break;
+
+ case TT_OP_UINT_LE:
+ result = (a.value.uint_val <= b.value.uint_val);
+ break;
+
+ case TT_OP_UINT_GT:
+ result = (a.value.uint_val > b.value.uint_val);
+ break;
+
+ case TT_OP_UINT_GE:
+ result = (a.value.uint_val >= b.value.uint_val);
+ break;
+
+ case TT_OP_INT64_EQ:
+ result = (a.value.int64_val == b.value.int64_val);
+ break;
+
+ case TT_OP_INT64_NE:
+ result = (a.value.int64_val != b.value.int64_val);
+ break;
+
+ case TT_OP_INT64_LT:
+ result = (a.value.int64_val < b.value.int64_val);
+ break;
+
+ case TT_OP_INT64_LE:
+ result = (a.value.int64_val <= b.value.int64_val);
+ break;
+
+ case TT_OP_INT64_GT:
+ result = (a.value.int64_val > b.value.int64_val);
+ break;
+
+ case TT_OP_INT64_GE:
+ result = (a.value.int64_val >= b.value.int64_val);
+ break;
+
+ case TT_OP_UINT64_EQ:
+ result = (a.value.uint64_val == b.value.uint64_val);
+ break;
+
+ case TT_OP_UINT64_NE:
+ result = (a.value.uint64_val != b.value.uint64_val);
+ break;
+
+ case TT_OP_UINT64_LT:
+ result = (a.value.uint64_val < b.value.uint64_val);
+ break;
+
+ case TT_OP_UINT64_LE:
+ result = (a.value.uint64_val <= b.value.uint64_val);
+ break;
+
+ case TT_OP_UINT64_GT:
+ result = (a.value.uint64_val > b.value.uint64_val);
+ break;
+
+ case TT_OP_UINT64_GE:
+ result = (a.value.uint64_val >= b.value.uint64_val);
+ break;
+
+ case TT_OP_DOUBLE_EQ:
+ result = (a.value.double_val == b.value.double_val);
+ break;
+
+ case TT_OP_DOUBLE_NE:
+ {
+ double diff = (a.value.double_val - b.value.double_val);
+ result = ((diff < -.0001) || (diff > .0001));
+ break;
+ }
+
+ case TT_OP_DOUBLE_LT:
+ result = (a.value.double_val < b.value.double_val);
+ break;
+
+ case TT_OP_DOUBLE_LE:
+ result = (a.value.double_val <= b.value.double_val);
+ break;
+
+ case TT_OP_DOUBLE_GT:
+ result = (a.value.double_val > b.value.double_val);
+ break;
+
+ case TT_OP_DOUBLE_GE:
+ result = (a.value.double_val >= b.value.double_val);
+ break;
+
+ case TT_OP_STR_EQ:
+ result = !strcmp(a.value.str_val, b.value.str_val);
+ break;
+
+ case TT_OP_STR_NE:
+ result = strcmp(a.value.str_val, b.value.str_val);
+ break;
+
+ case TT_OP_STR_LT:
+ result = (strcmp(a.value.str_val, b.value.str_val) < 0);
+ break;
+
+ case TT_OP_STR_LE:
+ result = (strcmp(a.value.str_val, b.value.str_val) <= 0);
+ break;
+
+ case TT_OP_STR_GT:
+ result = (strcmp(a.value.str_val, b.value.str_val) > 0);
+ break;
+
+ case TT_OP_STR_GE:
+ result = (strcmp(a.value.str_val, b.value.str_val) >= 0);
+ break;
+
+ case TT_OP_PTR_EQ:
+ result = (a.value.ptr_val == b.value.ptr_val);
+ break;
+
+ case TT_OP_PTR_NE:
+ result = (a.value.ptr_val != b.value.ptr_val);
+ break;
+
+ case TT_OP_FILE_EQ:
+ result = __tt_compare_files(a.value.str_val, b.value.str_val, TT_TRUE);
+ break;
+
+ case TT_OP_FILE_NE:
+ result = !__tt_compare_files(a.value.str_val, b.value.str_val, TT_TRUE);
+ break;
+
+ case TT_OP_TXTFILE_EQ:
+ result = __tt_compare_files_text(a.value.str_val, b.value.str_val,
+ TT_TRUE);
+ break;
+
+ case TT_OP_TXTFILE_NE:
+ result = !__tt_compare_files_text(a.value.str_val, b.value.str_val,
+ TT_TRUE);
+ break;
+
+ default:
+ break;
+ }
+
+ if(!result)
+ {
+ __tt_current_suite->current_test->failed = TT_TRUE;
+
+ printf("%s:%d: failed %s: %s [", file, line, (fatal ? "assert" : "expect"),
+ aexpr);
+ tt_output_val(stdout, &a);
+ printf("] %s %s [", __tt_op_strings[op], bexpr);
+ tt_output_val(stdout, &b);
+ puts("]");
+
+ if(fatal)
+ longjmp(__tt_current_suite->jump_buf, 0);
+ }
+}
+
+/*
+ */
+
+void tt_expect_bool(const char *file, int line, const char *expr, tt_op_t op,
+ int val, tt_bool_t fatal)
+{
+ tt_bool_t result = TT_FALSE;
+
+ switch(op)
+ {
+ case TT_OP_TRUE:
+ result = (val != 0);
+ break;
+
+ case TT_OP_FALSE:
+ result = (val == 0);
+ break;
+
+ default:
+ break;
+ }
+
+ if(!result)
+ {
+ __tt_current_suite->current_test->failed = TT_TRUE;
+
+ printf("%s:%d: failed %s: %s(%s)\n", file, line,
+ (fatal ? "assert" : "expect"), __tt_op_strings[op], expr);
+
+ if(fatal)
+ longjmp(__tt_current_suite->jump_buf, 0);
+ }
+}
+
+/*
+ */
+
+void tt_fail(const char *file, int line, const char *message, ...)
+{
+ va_list vp;
+ va_start(vp, message);
+ printf("%s:%d: failed: ", file, line);
+ vprintf(message, vp);
+ va_end(vp);
+ putchar('\n');
+}
+
+/*
+ */
+
+tt_bool_t tt_file_exists(const char *file)
+{
+ return(access(file, F_OK) == 0);
+}
+
+#ifdef _MSC_VER
+
+// All of this extra code is because MSVC doesn't support the C99 standard.
+// Sigh.
+
+/*
+ */
+
+void tt_test_int(const char *file, int line, const char *aexpr, tt_op_t op,
+ const char *bexpr, int a, int b, tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_INT }, bval = { TT_VAL_INT };
+ aval.value.int_val = a;
+ bval.value.int_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+/*
+ */
+
+void tt_test_uint(const char *file, int line, const char *aexpr, tt_op_t op,
+ const char *bexpr, unsigned int a, unsigned int b,
+ tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_UINT }, bval = { TT_VAL_UINT };
+ aval.value.uint_val = a;
+ bval.value.uint_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+/*
+ */
+
+void tt_test_int64(const char *file, int line, const char *aexpr, tt_op_t op,
+ const char *bexpr, long long a, long long b,
+ tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_INT64 }, bval = { TT_VAL_INT64 };
+ aval.value.int64_val = a;
+ bval.value.int64_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+/*
+ */
+
+void tt_test_uint64(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, unsigned long long a,
+ unsigned long long b, tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_UINT64 }, bval = { TT_VAL_UINT64 };
+ aval.value.uint64_val = a;
+ bval.value.uint64_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+/*
+ */
+
+void tt_test_double(const char *file, int line, const char *aexpr, tt_op_t op,
+ const char *bexpr, double a, double b, tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_DOUBLE }, bval = { TT_VAL_DOUBLE };
+ aval.value.double_val = a;
+ bval.value.double_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+/*
+ */
+
+void tt_test_str(const char *file, int line, const char *aexpr, tt_op_t op,
+ const char *bexpr, const char *a, const char *b,
+ tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_STR }, bval = { TT_VAL_STR };
+ aval.value.str_val = a;
+ bval.value.str_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+/*
+ */
+
+void tt_test_ptr(const char *file, int line, const char *aexpr, tt_op_t op,
+ const char *bexpr, const void *a, const void *b,
+ tt_bool_t fatal)
+{
+ tt_val_t aval = { TT_VAL_PTR }, bval = { TT_VAL_PTR };
+ aval.value.ptr_val = a;
+ bval.value.ptr_val = b;
+ tt_expect(file, line, aexpr, op, bexpr, aval, bval, fatal);
+}
+
+#endif // WIN32
+
+/* end of source file */
diff --git a/tinytest/tinytest.h b/tinytest/tinytest.h
new file mode 100644
index 0000000..b206788
--- /dev/null
+++ b/tinytest/tinytest.h
@@ -0,0 +1,538 @@
+/* ----------------------------------------------------------------------------
+ tinytest - A tiny C unit-testing library
+ Copyright (C) 2010-2018 Mark A Lindner
+
+ This file is part of tinytest.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>.
+ ----------------------------------------------------------------------------
+*/
+
+#ifndef __tinytest_h
+#define __tinytest_h
+
+#include <setjmp.h>
+#include <string.h>
+#include <stdlib.h>
+
+typedef int tt_bool_t;
+
+#define TT_TRUE (1)
+#define TT_FALSE (0)
+
+typedef struct tt_test_t
+{
+ const char *name;
+ void (*function)(void);
+ tt_bool_t failed;
+ struct tt_test_t *next;
+} tt_test_t;
+
+typedef struct tt_testsuite_t
+{
+ const char *name;
+ tt_test_t *first_test;
+ tt_test_t *last_test;
+ tt_test_t *current_test;
+ int num_tests;
+ int num_failures;
+ jmp_buf jump_buf;
+} tt_testsuite_t;
+
+typedef enum { TT_VAL_INT, TT_VAL_UINT, TT_VAL_INT64, TT_VAL_UINT64,
+ TT_VAL_DOUBLE, TT_VAL_STR, TT_VAL_PTR } tt_valtype_t;
+
+typedef enum { TT_OP_INT_EQ, TT_OP_INT_NE, TT_OP_INT_LT, TT_OP_INT_LE,
+ TT_OP_INT_GT, TT_OP_INT_GE, TT_OP_UINT_EQ, TT_OP_UINT_NE,
+ TT_OP_UINT_LT, TT_OP_UINT_LE, TT_OP_UINT_GT, TT_OP_UINT_GE,
+ TT_OP_INT64_EQ, TT_OP_INT64_NE, TT_OP_INT64_LT, TT_OP_INT64_LE,
+ TT_OP_INT64_GT, TT_OP_INT64_GE, TT_OP_UINT64_EQ,
+ TT_OP_UINT64_NE, TT_OP_UINT64_LT, TT_OP_UINT64_LE,
+ TT_OP_UINT64_GT, TT_OP_UINT64_GE, TT_OP_DOUBLE_EQ,
+ TT_OP_DOUBLE_NE, TT_OP_DOUBLE_LT, TT_OP_DOUBLE_LE,
+ TT_OP_DOUBLE_GT, TT_OP_DOUBLE_GE, TT_OP_STR_EQ, TT_OP_STR_NE,
+ TT_OP_STR_LT, TT_OP_STR_LE, TT_OP_STR_GT, TT_OP_STR_GE,
+ TT_OP_PTR_EQ, TT_OP_PTR_NE, TT_OP_TRUE, TT_OP_FALSE,
+ TT_OP_FILE_EQ, TT_OP_FILE_NE, TT_OP_TXTFILE_EQ,
+ TT_OP_TXTFILE_NE } tt_op_t;
+
+typedef struct tt_val_t
+{
+ tt_valtype_t type;
+ union {
+ int int_val;
+ unsigned int uint_val;
+ long long int64_val;
+ unsigned long long uint64_val;
+ double double_val;
+ const char *str_val;
+ const void *ptr_val;
+ } value;
+} tt_val_t;
+
+
+extern tt_testsuite_t *tt_suite_create(const char *name);
+
+extern void tt_suite_destroy(tt_testsuite_t *suite);
+
+extern void tt_suite_add_test(tt_testsuite_t *suite, const char *name,
+ void (*function)(void));
+
+extern void tt_suite_run(tt_testsuite_t *suite);
+
+extern void tt_expect(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr,
+ const tt_val_t a, const tt_val_t b,
+ tt_bool_t fatal);
+
+extern void tt_expect_bool(const char *file, int line, const char *expr,
+ tt_op_t op, int val, tt_bool_t fatal);
+
+extern void tt_fail(const char *file, int line, const char *message, ...);
+
+extern tt_bool_t tt_file_exists(const char *file);
+
+#ifdef _MSC_VER
+
+extern void tt_test_int(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, int a, int b,
+ tt_bool_t fatal);
+
+#define TT_TEST_INT_(A, OP, B, F) \
+ tt_test_int(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_INT_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, (OP), #B, \
+ (tt_val_t){ TT_VAL_INT, .value.int_val = (A) }, \
+ (tt_val_t){ TT_VAL_INT, .value.int_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_INT_EQ(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_INT_EQ(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_INT_NE(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_INT_NE(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_INT_LT(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_LT, (B), TT_FALSE)
+
+#define TT_ASSERT_INT_LT(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_LT, (B), TT_TRUE)
+
+#define TT_EXPECT_INT_LE(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_LE, (B), TT_FALSE)
+
+#define TT_ASSERT_INT_LE(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_LE, (B), TT_TRUE)
+
+#define TT_EXPECT_INT_GT(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_GT, (B), TT_FALSE)
+
+#define TT_ASSERT_INT_GT(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_GT, (B), TT_TRUE)
+
+#define TT_EXPECT_INT_GE(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_GE, (B), TT_FALSE)
+
+#define TT_ASSERT_INT_GE(A, B) \
+ TT_TEST_INT_((A), TT_OP_INT_GE, (B), TT_TRUE)
+
+#ifdef _MSC_VER
+
+extern void tt_test_uint(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, unsigned int a,
+ unsigned int b, tt_bool_t fatal);
+
+#define TT_TEST_UINT_(A, OP, B, F) \
+ tt_test_uint(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_UINT_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, OP, #B, \
+ (tt_val_t){ TT_VAL_UINT, .value.uint_val = (A) }, \
+ (tt_val_t){ TT_VAL_UINT, .value.uint_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_UINT_EQ(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT_EQ(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT_NE(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT_NE(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT_LT(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_LT, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT_LT(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_LT, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT_LE(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_LE, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT_LE(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_LE, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT_GT(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_GT, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT_GT(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_GT, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT_GE(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_GE, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT_GE(A, B) \
+ TT_TEST_UINT_((A), TT_OP_UINT_GE, (B), TT_TRUE)
+
+#ifdef _MSC_VER
+
+extern void tt_test_int64(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, long long a,
+ long long b, tt_bool_t fatal);
+
+#define TT_TEST_INT64_(A, OP, B, F) \
+ tt_test_int64(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_INT64_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, OP, #B, \
+ (tt_val_t){ TT_VAL_INT64, .value.int64_val = (A) }, \
+ (tt_val_t){ TT_VAL_INT64, .value.int64_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_INT64_EQ(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_INT64_EQ(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_INT64_NE(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_INT64_NE(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_INT64_LT(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_LT, (B), TT_FALSE)
+
+#define TT_ASSERT_INT64_LT(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_LT, (B), TT_TRUE)
+
+#define TT_EXPECT_INT64_LE(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_LE, (B), TT_FALSE)
+
+#define TT_ASSERT_INT64_LE(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_LE, (B), TT_TRUE)
+
+#define TT_EXPECT_INT64_GT(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_GT, (B), TT_FALSE)
+
+#define TT_ASSERT_INT64_GT(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_GT, (B), TT_TRUE)
+
+#define TT_EXPECT_INT64_GE(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_GE, (B), TT_FALSE)
+
+#define TT_ASSERT_INT64_GE(A, B) \
+ TT_TEST_INT64_((A), TT_OP_INT64_GE, (B), TT_TRUE)
+
+#ifdef _MSC_VER
+
+extern void tt_test_uint64(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr,
+ unsigned long long a, unsigned long long b,
+ tt_bool_t fatal);
+
+#define TT_TEST_UINT64_(A, OP, B, F) \
+ tt_test_uint64(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_UINT64_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, OP, #B, \
+ (tt_val_t){ TT_VAL_UINT64, .value.uint64_val = (A) }, \
+ (tt_val_t){ TT_VAL_UINT64, .value.uint64_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_UINT64_EQ(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT64_EQ(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT64_NE(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT64_NE(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT64_LT(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_LT, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT64_LT(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_LT, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT64_LE(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_LE, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT64_LE(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_LE, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT64_GT(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_GT, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT64_GT(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_GT, (B), TT_TRUE)
+
+#define TT_EXPECT_UINT64_GE(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_GE, (B), TT_FALSE)
+
+#define TT_ASSERT_UINT64_GE(A, B) \
+ TT_TEST_UINT64_((A), TT_OP_UINT64_GE, (B), TT_TRUE)
+
+#ifdef _MSC_VER
+
+extern void tt_test_double(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, double a,
+ double b, tt_bool_t fatal);
+
+#define TT_TEST_DOUBLE_(A, OP, B, F) \
+ tt_test_double(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_DOUBLE_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, OP, #B, \
+ (tt_val_t){ TT_VAL_DOUBLE, .value.double_val = (A) }, \
+ (tt_val_t){ TT_VAL_DOUBLE, .value.double_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_DOUBLE_EQ(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_DOUBLE_EQ(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_DOUBLE_NE(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_DOUBLE_NE(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_DOUBLE_LT(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_LT, (B), TT_FALSE)
+
+#define TT_ASSERT_DOUBLE_LT(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_LT, (B), TT_TRUE)
+
+#define TT_EXPECT_DOUBLE_LE(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_LE, (B), TT_FALSE)
+
+#define TT_ASSERT_DOUBLE_LE(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_LE, (B), TT_TRUE)
+
+#define TT_EXPECT_DOUBLE_GT(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_GT, (B), TT_FALSE)
+
+#define TT_ASSERT_DOUBLE_GT(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_GT, (B), TT_TRUE)
+
+#define TT_EXPECT_DOUBLE_GE(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_GE, (B), TT_FALSE)
+
+#define TT_ASSERT_DOUBLE_GE(A, B) \
+ TT_TEST_DOUBLE_((A), TT_OP_DOUBLE_GE, (B), TT_TRUE)
+
+#ifdef _MSC_VER
+
+extern void tt_test_str(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, const char *a,
+ const char *b, tt_bool_t fatal);
+
+#define TT_TEST_STR_(A, OP, B, F) \
+ tt_test_str(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_STR_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, OP, #B, \
+ (tt_val_t){ TT_VAL_STR, .value.str_val = (A) }, \
+ (tt_val_t){ TT_VAL_STR, .value.str_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_STR_EQ(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_STR_EQ(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_STR_NE(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_STR_NE(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_STR_LT(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_LT, (B), TT_FALSE)
+
+#define TT_ASSERT_STR_LT(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_LT, (B), TT_TRUE)
+
+#define TT_EXPECT_STR_LE(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_LE, (B), TT_FALSE)
+
+#define TT_ASSERT_STR_LE(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_LE, (B), TT_TRUE)
+
+#define TT_EXPECT_STR_GT(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_GT, (B), TT_FALSE)
+
+#define TT_ASSERT_STR_GT(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_GT, (B), TT_TRUE)
+
+#define TT_EXPECT_STR_GE(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_GE, (B), TT_FALSE)
+
+#define TT_ASSERT_STR_GE(A, B) \
+ TT_TEST_STR_((A), TT_OP_STR_GE, (B), TT_TRUE)
+
+#ifdef _MSC_VER
+
+extern void tt_test_ptr(const char *file, int line, const char *aexpr,
+ tt_op_t op, const char *bexpr, const void *a,
+ const void *b, tt_bool_t fatal);
+
+#define TT_TEST_PTR_(A, OP, B, F) \
+ tt_test_ptr(__FILE__, __LINE__, #A, (OP), #B, (A), (B), (F))
+
+#else
+
+#define TT_TEST_PTR_(A, OP, B, F) \
+ tt_expect(__FILE__, __LINE__, #A, OP, #B, \
+ (tt_val_t){ TT_VAL_PTR, .value.ptr_val = (A) }, \
+ (tt_val_t){ TT_VAL_PTR, .value.ptr_val = (B) }, \
+ (F))
+
+#endif
+
+#define TT_EXPECT_PTR_EQ(A, B) \
+ TT_TEST_PTR_((A), TT_OP_PTR_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_PTR_EQ(A, B) \
+ TT_TEST_PTR_((A), TT_OP_PTR_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_PTR_NE(A, B) \
+ TT_TEST_PTR_((A), TT_OP_PTR_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_PTR_NE(A, B) \
+ TT_TEST_PTR_((A), TT_OP_PTR_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_PTR_NOTNULL(A) \
+ TT_TEST_PTR_((A), TT_OP_PTR_NE, NULL, TT_FALSE)
+
+#define TT_ASSERT_PTR_NOTNULL(A) \
+ TT_TEST_PTR_((A), TT_OP_PTR_NE, NULL, TT_TRUE)
+
+#define TT_EXPECT_PTR_NULL(A) \
+ TT_TEST_PTR_((A), TT_OP_PTR_EQ, NULL, TT_FALSE)
+
+#define TT_ASSERT_PTR_NULL(A) \
+ TT_TEST_PTR_((A), TT_OP_PTR_EQ, NULL, TT_TRUE)
+
+#define TT_EXPECT_TRUE(A) \
+ tt_expect_bool(__FILE__, __LINE__, #A, TT_OP_TRUE, (A), TT_FALSE)
+
+#define TT_ASSERT_TRUE(A) \
+ tt_expect_bool(__FILE__, __LINE__, #A, TT_OP_TRUE, (A), TT_TRUE)
+
+#define TT_EXPECT_FALSE(A) \
+ tt_expect_bool(__FILE__, __LINE__, #A, TT_OP_FALSE, (A), TT_FALSE)
+
+#define TT_ASSERT_FALSE(A) \
+ tt_expect_bool(__FILE__, __LINE__, #A, TT_OP_FALSE, (A), TT_TRUE)
+
+#define TT_EXPECT_FILE_EQ(A, B) \
+ TT_TEST_STR_((A), TT_OP_FILE_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_FILE_EQ(A, B) \
+ TT_TEST_STR_((A), TT_OP_FILE_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_FILE_NE(A, B) \
+ TT_TEST_STR_((A), TT_OP_FILE_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_FILE_NE(A, B) \
+ TT_TEST_STR_((A), TT_OP_FILE_NE, (B), TT_TRUE)
+
+#define TT_EXPECT_TXTFILE_EQ(A, B) \
+ TT_TEST_STR_((A), TT_OP_TXTFILE_EQ, (B), TT_FALSE)
+
+#define TT_ASSERT_TXTFILE_EQ(A, B) \
+ TT_TEST_STR_((A), TT_OP_TXTFILE_EQ, (B), TT_TRUE)
+
+#define TT_EXPECT_TXTFILE_NE(A, B) \
+ TT_TEST_STR_((A), TT_OP_TXTFILE_NE, (B), TT_FALSE)
+
+#define TT_ASSERT_TXTFILE_NE(A, B) \
+ TT_TEST_STR_((A), TT_OP_TXTFILE_NE, (B), TT_TRUE)
+
+#define TT_FAIL(M, ...) \
+ tt_fail(__FILE__, __LINE__, (M), __VA_ARGS__)
+
+#define TT_SUITE_START(S) \
+ tt_testsuite_t *__suite__ ## S = tt_suite_create(#S)
+
+#define TT_SUITE_TEST(S, F) \
+ tt_suite_add_test(__suite__ ## S, #F, F);
+
+#define TT_TEST(F) \
+ static void F(void)
+
+#define TT_SUITE_END(S) \
+ tt_suite_destroy(__suite__ ## S)
+
+#define TT_SUITE_RUN(S) \
+ tt_suite_run(__suite__ ## S)
+
+#define TT_SUITE_NUM_FAILURES(S) \
+ __suite__ ## S->num_failures
+
+#endif // __tinytest_h
diff --git a/tinytest/tinytest.vcproj b/tinytest/tinytest.vcproj
new file mode 100644
index 0000000..109089e
--- /dev/null
+++ b/tinytest/tinytest.vcproj
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libtinytest"
+ ProjectGUID="{58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}"
+ RootNamespace="libtinytest"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ProjectName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ProjectName)\$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ >
+ <File
+ RelativePath=".\tinytest.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ >
+ <File
+ RelativePath=".\tinytest.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/tinytest/tinytest.vcxproj b/tinytest/tinytest.vcxproj
new file mode 100644
index 0000000..bcb9a1a
--- /dev/null
+++ b/tinytest/tinytest.vcxproj
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug_Static|Win32">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_Static|x64">
+ <Configuration>Debug_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|Win32">
+ <Configuration>Release_Static</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_Static|x64">
+ <Configuration>Release_Static</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>libtinytest</ProjectName>
+ <ProjectGuid>{58F43D41-FE56-40E1-BB83-9CB8CDE0B7AA}</ProjectGuid>
+ <RootNamespace>libtinytest</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>15.0.26919.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)ds</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ <TargetName>$(ProjectName)s</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <TargetName>$(ProjectName)ds</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <TargetName>$(ProjectName)s</TargetName>
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)build\$(Platform)\</OutDir>
+ <IntDir>$(SolutionDir)\temp\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Static|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ <Link>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <OmitFramePointers>true</OmitFramePointers>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="tinytest.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="tinytest.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/tinytest/tinytest.vcxproj.filters b/tinytest/tinytest.vcxproj.filters
new file mode 100644
index 0000000..a55a62b
--- /dev/null
+++ b/tinytest/tinytest.vcxproj.filters
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4911ca64-c0fc-45b5-bb8a-fd6521ede707}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{75292bb9-19f9-4621-bbce-78ff3e48d720}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="tinytest.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="tinytest.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file