← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/zorba-2.6 into lp:~zorba-coders/zorba/zorba-experimental

 

Cezar Andrei has proposed merging lp:~zorba-coders/zorba/zorba-2.6 into lp:~zorba-coders/zorba/zorba-experimental.

Requested reviews:
  Cezar Andrei (cezar-andrei)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-2.6/+merge/120278

Just Zorba trunk at 2.6 tag. Experimental build for demo website.
-- 
The attached diff has been truncated due to its size.
https://code.launchpad.net/~zorba-coders/zorba/zorba-2.6/+merge/120278
Your team Zorba Coders is subscribed to branch lp:~zorba-coders/zorba/zorba-2.6.
=== added file '.bzrignore'
--- .bzrignore	1970-01-01 00:00:00 +0000
+++ .bzrignore	2012-08-19 03:54:29 +0000
@@ -0,0 +1,2 @@
+CMakeLists.txt.user
+build

=== modified file 'CMakeCPack.cmake'
--- CMakeCPack.cmake	2011-08-24 09:09:02 +0000
+++ CMakeCPack.cmake	2012-08-19 03:54:29 +0000
@@ -31,6 +31,9 @@
 SET(CPACK_COMPONENT_PHP_SWIG_DISPLAY_NAME "PHP API")
 SET(CPACK_COMPONENT_PYTHON_SWIG_DISPLAY_NAME "Python API")
 SET(CPACK_COMPONENT_RUBY_SWIG_DISPLAY_NAME "Ruby API")
+SET(CPACK_COMPONENT_XQJ_SWIG_DISPLAY_NAME "Java XQJ API")
+SET(CPACK_COMPONENT_THESAURUS_DISPLAY_NAME "Thesaurus")
+SET(CPACK_COMPONENT_CSHARP_SWIG_DISPLAY_NAME "C# API")
 
 SET(CPACK_COMPONENT_UNSPECIFIED_DESCRIPTION "Zorba Required Files.")
 SET(CPACK_COMPONENT_DOC_DESCRIPTION "Files with the Description of different features of zorba.")
@@ -42,6 +45,9 @@
 SET(CPACK_COMPONENT_PHP_SWIG_DESCRIPTION "API for PHP")
 SET(CPACK_COMPONENT_PYTHON_SWIG_DESCRIPTION "API for Python")
 SET(CPACK_COMPONENT_RUBY_SWIG_DESCRIPTION "API for Ruby")
+SET(CPACK_COMPONENT_XQJ_SWIG_DESCRIPTION "XQJ API for Java")
+SET(CPACK_COMPONENT_THESAURUS_DESCRIPTION "Thesaurus for Zorba")
+SET(CPACK_COMPONENT_CSHARP_SWIG_DESCRIPTION "API for C#")
 
 SET(CPACK_COMPONENT_DOC_GROUP "Documents")
 SET(CPACK_COMPONENT_PHP_EXAMPLES_GROUP "Documents")
@@ -53,6 +59,8 @@
 SET(CPACK_COMPONENT_PHP_SWIG_GROUP "APIs")
 SET(CPACK_COMPONENT_PYTHON_SWIG_GROUP "APIs")
 SET(CPACK_COMPONENT_RUBY_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_XQJ_SWIG_GROUP "APIs")
+SET(CPACK_COMPONENT_CSHARP_SWIG_GROUP "APIs")
 
 SET(CPACK_COMPONENT_GROUP_EXTERNAL_MODULES_DISPLAY_NAME "External Modules")
 SET(CPACK_COMPONENT_GROUP_EXTERNAL_MODULES_DESCRIPTION "Complete list of external modules.")
@@ -70,9 +78,10 @@
 SET(CPACK_COMPONENT_PYTHON_SWIG_INSTALL_TYPES Full)
 SET(CPACK_COMPONENT_PHP_SWIG_INSTALL_TYPES Full)
 SET(CPACK_COMPONENT_RUBY_SWIG_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_XQJ_SWIG_INSTALL_TYPES Full)
 SET(CPACK_COMPONENT_UNSPECIFIED_INSTALL_TYPES Full Simple Lite)
-
-SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN)
+SET(CPACK_COMPONENT_THESAURUS_INSTALL_TYPES Full)
+SET(CPACK_COMPONENT_CSHARP_SWIG_INSTALL_TYPES Full)
 
 INCLUDE(${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake)
 

=== modified file 'CMakeCPackOptions.cmake.in'
--- CMakeCPackOptions.cmake.in	2011-09-01 21:44:44 +0000
+++ CMakeCPackOptions.cmake.in	2012-08-19 03:54:29 +0000
@@ -28,7 +28,7 @@
   SET(CPACK_NSIS_CONTACT "info@xxxxxxxxxxxxxx")
   
   SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
-    CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Zorba Command Line Client.lnk' 'cmd.exe' '/K set path=%path%;%cd%\\bin&echo Start using Zorba: zorba -q 1+1  or  zorba -f -q example.xq'
+    CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Zorba Command Line Client.lnk' 'cmd.exe' '/K set path=%path%;%JAVA_HOME%;%JAVA_HOME%\\client;%cd%\\bin;&echo Start using Zorba: zorba -q 1+1  or  zorba -f -q example.xq'
     CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Zorba Documentation.lnk' '$INSTDIR\\\\share\\\\doc\\\\zorba-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\\\\zorba\\\\html\\\\index.html'
     CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Modules Documentation.lnk' '$INSTDIR\\\\share\\\\doc\\\\zorba-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\\\\zorba\\\\xqdoc\\\\xhtml\\\\index.html'
     ")

=== modified file 'CMakeCompiler.txt'
--- CMakeCompiler.txt	2011-01-19 12:48:17 +0000
+++ CMakeCompiler.txt	2012-08-19 03:54:29 +0000
@@ -108,6 +108,9 @@
   IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
   ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
+  IF(NOT CMAKE_CXX_FLAGS MATCHES "-D_FILE_OFFSET_BITS")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64")
+  ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-D_FILE_OFFSET_BITS")
   IF (UNIX AND NOT APPLE)
     IF (NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "as-needed")
       SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")

=== modified file 'CMakeConfiguration.txt'
--- CMakeConfiguration.txt	2011-09-16 19:55:59 +0000
+++ CMakeConfiguration.txt	2012-08-19 03:54:29 +0000
@@ -70,10 +70,6 @@
 SET(ZORBA_FOR_ONE_THREAD_ONLY OFF CACHE BOOL "compile zorba for single threaded use")
 MESSAGE(STATUS "ZORBA_FOR_ONE_THREAD_ONLY:            " ${ZORBA_FOR_ONE_THREAD_ONLY})
 
-# by default the zorba command line client is deactivated until it gets to a more stable and userfriendly state
-SET(ZORBA_WITH_DEBUGGER_CLIENT OFF CACHE BOOL "build and install zorbas command line debugger client")
-MESSAGE(STATUS "ZORBA_WITH_DEBUGGER_CLIENT:           " ${ZORBA_WITH_DEBUGGER_CLIENT})
-
 IF (DEFINED UNIX)
   IF (NOT DEFINED ZORBA_HAVE_PTHREAD_H AND NOT DEFINED ZORBA_FOR_ONE_THREAD_ONLY)
     MESSAGE(FATAL_ERROR "pthread is not available")
@@ -139,14 +135,14 @@
 SET (ZORBA_DEBUG_STRING ${ZORBA_DEBUG_STRING} CACHE BOOL "debug strings")
 MESSAGE (STATUS "ZORBA_DEBUG_STRING:                   " ${ZORBA_DEBUG_STRING})
 
-SET(ZORBA_NO_UNICODE OFF CACHE BOOL "disable ICU")
-MESSAGE(STATUS "ZORBA_NO_UNICODE:                     " ${ZORBA_NO_UNICODE})
+SET(ZORBA_NO_ICU OFF CACHE BOOL "disable ICU")
+MESSAGE(STATUS "ZORBA_NO_ICU:                         " ${ZORBA_NO_ICU})
 
-IF (ZORBA_NO_UNICODE)
+IF (ZORBA_NO_ICU)
   SET (no_full_text ON)
-ELSE (ZORBA_NO_UNICODE)
+ELSE (ZORBA_NO_ICU)
   SET (no_full_text OFF)
-ENDIF (ZORBA_NO_UNICODE)
+ENDIF (ZORBA_NO_ICU)
 SET (ZORBA_NO_FULL_TEXT ${no_full_text} CACHE BOOL "disable XQuery Full-Text support")
 MESSAGE(STATUS "ZORBA_NO_FULL_TEXT:                   " ${ZORBA_NO_FULL_TEXT})
 
@@ -156,6 +152,13 @@
 SET(ZORBA_WITH_BIG_INTEGER OFF CACHE BOOL "enable arbitrary precision integers")
 MESSAGE(STATUS "ZORBA_WITH_BIG_INTEGER:               " ${ZORBA_WITH_BIG_INTEGER})
 
+SET(ZORBA_WITH_JSON ON CACHE BOOL "enable integrated JSON support")
+MESSAGE(STATUS "ZORBA_WITH_JSON:                      " ${ZORBA_WITH_JSON})
+
+SET(ZORBA_WITH_THESAURUS ON CACHE BOOL
+    "enable installation of default English Wordnet thesaurus")
+MESSAGE(STATUS "ZORBA_WITH_THESAURUS:                 " ${ZORBA_WITH_THESAURUS})
+
 IF (ZORBA_SUPPRESS_SWIG)
   SET (no_swig ON)
 ELSE (ZORBA_SUPPRESS_SWIG)

=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2011-09-08 15:09:20 +0000
+++ CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -65,6 +65,7 @@
 
 # Enable RPaths in installed binaries
 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 # turn on the folder grouping used by IDEs (VS or XCode)
 SET(ZORBA_USE_TARGET_FOLDERS ON CACHE BOOL "Activate use of target grouping into folders")
@@ -122,34 +123,62 @@
 CHECK_TYPE_SIZE("__int32" ZORBA_HAVE_MS_INT32) 
 CHECK_TYPE_SIZE("int64_t" ZORBA_HAVE_INT64_T) 
 
-CHECK_CXX_SOURCE_COMPILES ("#include <type_traits>\nint main() { std::enable_if<true,int> x; }" ZORBA_CXX_ENABLE_IF)
-CHECK_CXX_SOURCE_COMPILES ("int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)
-CHECK_CXX_SOURCE_COMPILES ("int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT)
-CHECK_CXX_SOURCE_COMPILES ("#include <memory>\nint main() { std::unique_ptr<int> p; }" ZORBA_CXX_UNIQUE_PTR)
+# C++ built-in type sizes
+CHECK_TYPE_SIZE("double" ZORBA_SIZEOF_DOUBLE BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("float" ZORBA_SIZEOF_FLOAT BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("int" ZORBA_SIZEOF_INT BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("long" ZORBA_SIZEOF_LONG BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("long long" ZORBA_SIZEOF_LONG_LONG BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("void*" ZORBA_SIZEOF_POINTER BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("short" ZORBA_SIZEOF_SHORT BUILTIN_TYPES_ONLY) 
+CHECK_TYPE_SIZE("size_t" ZORBA_SIZEOF_SIZE_T) 
+SET(CMAKE_EXTRA_INCLUDE_FILES wchar.h)
+CHECK_TYPE_SIZE("wchar_t" ZORBA_SIZEOF_WCHAR_T)
+SET(CMAKE_EXTRA_INCLUDE_FILES)
+
+# C++11 langauge features
+CHECK_CXX_SOURCE_COMPILES(
+  "int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)
+CHECK_CXX_SOURCE_COMPILES(
+  "int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT)
+
+# C++11 standard library types
+CHECK_CXX_SOURCE_COMPILES (
+  "#include <type_traits>
+  int main() { std::enable_if<true,int> x; }" ZORBA_HAVE_ENABLE_IF)
+CHECK_CXX_SOURCE_COMPILES ("
+  #include <memory>
+  int main() { std::unique_ptr<int> p; }" ZORBA_HAVE_UNIQUE_PTR)
+CHECK_CXX_SOURCE_COMPILES (
+  "#include <unordered_map>
+  int main() { std::unordered_map<int,int> m; }" ZORBA_HAVE_UNORDERED_MAP)
+CHECK_CXX_SOURCE_COMPILES (
+  "#include <unordered_set>
+  int main() { std::unordered_set<int> s; }" ZORBA_HAVE_UNORDERED_SET)
 
 ################################################################################
 # Various cmake macros
 
-IF(WIN32)
+SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ${CMAKE_MODULE_PATH})
+IF (WIN32)
   # On Windows we use proxy modules that try to guess first the location
   # of the required third party libraries. This will search in order in:
   # 1. the path pointed by ZORBA_THIRD_PARTY_REQUIREMENTS
   # 2. the Program Files directory available on the users computer
   # 3. the PATH environment variable
   # The logic is implemented by the macros in the ProxyFindModule.cmake module.
-  LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules/Windows")
-  INCLUDE(ProxyFindModule)
-ENDIF(WIN32)
-LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
-
+  SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/Windows ${CMAKE_MODULE_PATH})
+  INCLUDE (ProxyFindModule)
+ENDIF (WIN32)
 
 ################################################################################
-# This section is used for batch script generation. Each executable
-# on Windows needs a bat script in order to set the PATH to the required DLLs.
+# This section is used for batch script and Visual Studio Project file generation. 
+# Each executable on Windows needs a bat script and in the Visual Studio build a \
+# pre-generated Visual Studio Project file in order to set the PATH to the required DLLs.
 # For this we use CACHE variables to gather all the information generated
 # throughout the cmake execution (required DLLs, list of scripts to generate).
 # The generation occurs only at the end of CMake execution (through the macro
-# ZORBA_GENERATE_EXE_SCRIPTS_WIN32) when ALL the requirements have been found.
+# ZORBA_GENERATE_EXE_HELPERS_WIN32) when ALL the requirements have been found.
 # E.g. zorba.exe needs in PATH all the DLLs of all external modules, etc.
 IF (WIN32)
   # Clear all the variables because they are used only for this build.
@@ -162,10 +191,19 @@
   SET (ZORBA_EXE_SCRIPT_LIST ""
     CACHE STRING "List of Windows batch scripts to be generated, one for each executable" FORCE
   )
+  IF (MSVC_IDE)
+    SET (ZORBA_VC_PROJECT_FILE_LIST ""
+      CACHE STRING "List of Visual Studio project files to be generated, one for each executable" FORCE
+    )
+  ENDIF(MSVC_IDE)
+
   # Moreover, mark it as advanced since the CMake GUI user should not see this.
   MARK_AS_ADVANCED (FORCE ZORBA_REQUIRED_DLLS)
   MARK_AS_ADVANCED (FORCE ZORBA_REQUIRED_DLL_PATHS)
   MARK_AS_ADVANCED (FORCE ZORBA_EXE_SCRIPT_LIST)
+  IF (MSVC_IDE)
+    MARK_AS_ADVANCED (FORCE ZORBA_VC_PROJECT_FILE_LIST)
+  ENDIF(MSVC_IDE)
 ENDIF (WIN32)
 ################################################################################
 
@@ -238,11 +276,21 @@
 MESSAGE(STATUS "Looking for LibXml2")
 FIND_PACKAGE(LibXml2)
 IF(LIBXML2_FOUND)
-  MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})
-    
-  INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
-  SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})
-  SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
+  # Now check LibXml2's version
+  FILE(STRINGS ${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h LIBXML2_VERSION_TMP REGEX 
+       "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\".*\"")
+  STRING(REGEX REPLACE "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\"(.*)\"" "\\1" 
+         LIBXML2_VERSION ${LIBXML2_VERSION_TMP})
+         
+  IF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
+    MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})
+    INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
+    SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})
+    SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
+  ELSE(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
+    MESSAGE(FATAL_ERROR "The libxml2 library version 2.7.0 or higher is required in order to build Zorba.")
+  ENDIF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
+
 ELSE(LIBXML2_FOUND)
   MESSAGE(FATAL_ERROR "The libxml2 library and headers are required in order to build simple store.")
 ENDIF(LIBXML2_FOUND)
@@ -296,6 +344,13 @@
 MESSAGE (STATUS "")
 
 #
+# shlwapi
+#
+IF(WIN32)
+    SET(requiredlibs ${requiredlibs} "shlwapi")
+ENDIF(WIN32)
+
+#
 # SWIG
 #
 IF (NOT ZORBA_SUPPRESS_SWIG)
@@ -394,10 +449,11 @@
 IF(WIN32)
   SET(requiredlibs ${requiredlibs} wsock32)
   
-  # Clear this variable because this is used only for this build.
+  # Clear those variables because this is used only for this build.
   # A cache variable is needed since this must be modified by subdirectories
-  # and be visible at this level when ZORBA_GENERATE_EXE_SCRIPTS_WIN32 is called
+  # and be visible at this level when ZORBA_GENERATE_EXE_HELPERS_WIN32 is called
   SET(ZORBA_EXE_SCRIPT_LIST "" CACHE STRING "List of bat scripts" FORCE)
+  SET(ZORBA_VC_PROJECT_FILE_LIST "" CACHE STRING "List of VC project files" FORCE)
 ENDIF(WIN32)
 
 ################################################################################
@@ -418,13 +474,35 @@
 
 # zorba versioning
 SET(ZORBA_MAJOR_NUMBER "2")
-SET(ZORBA_MINOR_NUMBER "0")
-SET(ZORBA_PATCH_NUMBER "1")
+SET(ZORBA_MINOR_NUMBER "6")
+SET(ZORBA_PATCH_NUMBER "0")
 SET(ZORBA_VERSION ${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER})
 MESSAGE(STATUS "Zorba version number: ${ZORBA_VERSION}")
-SET(ZORBA_MODULES_INSTALL_DIR "share/zorba-${ZORBA_VERSION}/modules"
-  CACHE STRING "Path (relative to installdir) to modules" FORCE)
-MARK_AS_ADVANCED(ZORBA_MODULES_INSTALL_DIR)
+
+SET(ZORBA_LIB_DIRNAME "lib" CACHE STRING
+  "directory name for libs (may want to set to 'lib64' on 64-bit Linux platforms)")
+
+# Directories for modules and schemas. "Core" are those which are
+# shipped with Zorba and must be present for correct Zorba
+# functionality. "Non-core" are developed independently of Zorba and
+# have different version lifecycles.
+#
+# URI dir is for things resolved by URI - specifically modules (.xq
+# files) and schemas (.xsd files) - which are platform-
+# independent. Lib dir is for platform-specific files, specifically
+# shared libraries for module external functions.
+SET(ZORBA_NONCORE_URI_DIR "share/zorba/uris"
+  CACHE STRING "Path (relative to installdir) to non-core modules/schemas")
+MARK_AS_ADVANCED(ZORBA_NONCORE_URI_DIR)
+SET(ZORBA_CORE_URI_DIR "${ZORBA_NONCORE_URI_DIR}/core/${ZORBA_VERSION}"
+  CACHE STRING "Path (relative to installdir) to core modules/schemas")
+MARK_AS_ADVANCED(ZORBA_CORE_URI_DIR)
+SET(ZORBA_NONCORE_LIB_DIR "${ZORBA_LIB_DIRNAME}/zorba"
+  CACHE STRING "Path (relative to installdir) to non-core libraries")
+MARK_AS_ADVANCED(ZORBA_NONCORE_LIB_DIR)
+SET(ZORBA_CORE_LIB_DIR "${ZORBA_NONCORE_LIB_DIR}/core/${ZORBA_VERSION}"
+  CACHE STRING "Path (relative to installdir) to core libraries")
+MARK_AS_ADVANCED(ZORBA_CORE_LIB_DIR)
 
 # add compiler variables
 ADD_DEFINITIONS(${DEFINITIONS})
@@ -461,7 +539,7 @@
   SET(ZORBA_CMAKE_DIR "cmake" CACHE STRING
     "Relative path to CMake files in Zorba installation")
 ELSE (WIN32)
-  SET(ZORBA_CMAKE_DIR "share/zorba-${ZORBA_VERSION}/cmake" CACHE STRING
+  SET(ZORBA_CMAKE_DIR "share/cmake/zorba-${ZORBA_VERSION}" CACHE STRING
     "Relative path to CMake files in Zorba installation")
 ENDIF (WIN32)
 
@@ -477,14 +555,16 @@
 # Subdirectory ordering: We need to include "test" before "config" so
 # ZorbaConfig knows about testdriver. We need to include "config"
 # before "modules" so external modules will be able to find
-# ZorbaConfig.cmake.
+# ZorbaConfig.cmake. We need to include "modules" before "include" so
+# config.h can know eg. whether we found CURL. We need to include "modules"
+# before "doc" so xqdoc can know what non-core modules are available.
 
 ADD_SUBDIRECTORY(test)
 ADD_SUBDIRECTORY(config)
-ADD_SUBDIRECTORY(include)
-ADD_SUBDIRECTORY(doc)
 ADD_SUBDIRECTORY(schemas)
 ADD_SUBDIRECTORY(modules)
+ADD_SUBDIRECTORY(doc)
+ADD_SUBDIRECTORY(include)
 
 ADD_DEFINITIONS(-Dzorba_EXPORTS)
 ADD_SUBDIRECTORY(src)
@@ -523,7 +603,7 @@
 ENDIF (APPLE AND UNIVERSAL)
 
 IF (WIN32)
-  ZORBA_GENERATE_EXE_SCRIPTS_WIN32 ()
+  ZORBA_GENERATE_EXE_HELPERS_WIN32 ()
 ENDIF (WIN32)
 
 # This must be done last! Create the one top-level target which
@@ -535,4 +615,4 @@
 # This dependency is zorba-only related, which is why it's added here
 # and not within zorba-modules, which is for general use in other
 # non-zorba modules.
-ADD_DEPENDENCIES(check_uris gen_diag_modules)
+ADD_DEPENDENCIES(check_core_uris gen_diag_modules)

=== modified file 'CPackSourceConfig.cmake.in'
--- CPackSourceConfig.cmake.in	2009-10-30 16:24:51 +0000
+++ CPackSourceConfig.cmake.in	2012-08-19 03:54:29 +0000
@@ -19,7 +19,7 @@
 
 SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
 SET(CPACK_GENERATOR "TGZ;TZ")
-SET(CPACK_IGNORE_FILES "test/coverity/;dist/;_CPack_Packages/;build/;build./;CVS/;/\\.svn/;\\.swp$;\\.#;/#")
+SET(CPACK_IGNORE_FILES "test/coverity/;dist/;_CPack_Packages/;build/;build./;CVS/;/\\.svn/;\\.swp$;\\.#;/#;\\.bzr/")
 SET(CPACK_INSTALLED_DIRECTORIES "@CMAKE_SOURCE_DIR@;/")
 SET(CPACK_INSTALL_CMAKE_PROJECTS "")
 SET(CPACK_MODULE_PATH "")

=== modified file 'ChangeLog'
--- ChangeLog	2011-10-05 22:39:18 +0000
+++ ChangeLog	2012-08-19 03:54:29 +0000
@@ -1,13 +1,233 @@
 Zorba - The XQuery Processor
 
-version 2.x
-
-  * Custom Full-text thesaurus.
-  * Fixed bug #3401971 (node-by-reference on dynamic collections)
+
+version 2.6
+
+New Features:
+  * Include first-class support for JSON data by implementing the JSONiq spec
+  - see http://www.jsoniq.org/ for more information. This feature is enabled by default.
+  * Implemented the new EQName syntax (use Q{namespace}local instead of "namespace":local)
+  * New function Item::isSeekable for streamable content (xs:string and xs:base64Binary)
+  * Implemented the latest W3C specification for the group by clause (backwards incompatible)
+  * New ft:tokenize-nodes() function to full-text module
+  * New XQuery 3.0 function fn:parse-xml-fragment#1
+  * New ItemFactory function that allows creating dateTime items without timezone
+  * Added support for transient maps to the
+    http://www.zorba-xquery.com/modules/store/data-structures/unordered-map module.
+  * Added support for fragments to fn:path
+  * Positional pagination support for collections
+  * New function in the http://www.zorba-xquery.com/modules/store/static/indexes/dml module which returns
+    the value of all keys contained in an index
+  * Incremental maintenance for general indexes
+	
+Optimizations:
+  * Optimization of comparison operations
+  * Tighter hoisting of expressions (also fixes bug #967428)
+  * Optimized hash sets used by fn:distinct-values and nodes-distinct
+  * Optimized hash function used for nodes (also fixes bug #1010051)
+  * Rewrite of plan serializer internals, resulting in big performance improvement
+  * Avoid treat expr for checking that the value of a non-external
+    global variable conforms to the type declaration of the variable
+  * Streaming execution for tumbling windows (also fixes bug #1010051)
+
+Bug Fixes/Other Changes:
+  * Fixed bug #1025622 (Incorrect JSON serialization of supplementary plane code points)
+  * Fixed bug #1016606 (DOCTYPE in the input of the parse-fragment function)
+  * Fixed bug #1002993 (bug during revalidation after update; improper condition
+    for calling TypeOps::get_atomic_type_code() from
+    SchemaValidatorImpl::isPossibleSimpleContentRevalImpl())
+  * Fixed bug #867357 (Improved parser error messages)
+  * Fixed bug #1026379 ("q" flag for fn:replace() is ignored)
+  * Fixed bug #932314 (non-comparable values must be treated as distinct by
+    fn:distinct-values)
+  * Fixed bug #1015580 (Add base64_streambuf / replace inefficient base64 code)
+  * Fixed bug #1022557 (subsequence function applied on window variable)
+  * Fixed bug #9910884 (raise XUST0001 in trycatch with mixed updating and simple clauses)
+  * Fixed bug #854506 (ugly type error messages) and partial fix for bug #867008
+  * Fixed bug #1008082 (bug in transform expr when a copy var is not used anywhere)
+  * Fixed bug #898066 (Stringstream & fn:trace)
+  * Fixed numbering of items in fn:trace starts with one
+  * Fixed bug #1003023$ (optimizer problems due to common subexpression after
+    var folding into if-then-else)
+  * Fixed bug #1006166 (disabling 2 functions with the same qname)
+  * Fixed bug #960083 (improper error handling of NaN comparisons)
+  * Fixed bug #878508 (JsonML serialization not escaping characters)
+  * The XML plan serialization format is not supported anymore
+
+
+version 2.5
+
+New Features:
+  * New XQuery 3.0 functions
+    - fn:available-environment-variables
+    - fn:environment-variables
+    - fn:uri-collection
+    - fn:unparsed-text
+    - fn:unparsed-text-available
+    - fn:has-children#0
+    - fn:nilled#0
+    - fn:path
+  * Added base64:decode#2 function which also does transcoding
+  * Extended API for Python, Java, PHP and Ruby
+  * Added JVM classpath to zorbacmd and to Zorba API
+  * Added full-text module
+  * Added support for NO_ICU (to not use ICU for unicode processing)
+  * Added XQJ support
+  * Added CollectionManager and DocumentManager support for XQJ
+  * Added new API EntityKind SOME_CONTENT
+  * Added new API StreamResource which is able to specify whether a
+    stream is seekable or not.
+  * Added new functions in the fetch module and the StaticContext to fetch
+    resources as binary
+  * Added non-core schema-tools module for getting sample XMLSchema from
+    XML instances and sample XML instances from XMLSchema.
+
+Optimizations:
+  * optimized insertion into a collection (don't copy it if the node was
+    created by an element constructor and is not used anywhere else in the query)
+  * Fixed performance problem with the findNodeSources function of the no-copy rule
+
+Bug Fixes/Other Changes:
+  * Fixed bug #867170 (Variables declared in Prolog are Overwritten inside the query)
+  * Fixed bug #1001463 (type not available during computation of function caching)
+  * Fixed bug #1002867 (resulting base64 in http-client is wrong)
+  * Fixed bugs #905028 (Allow to set base URI to undefined)
+  * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number()
+  * fn:format-number raises FODF1310 instead of XTDE1310
+  * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
+  * Fixed bug #862971 (no error upon duplicate function declarations)
+  * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
+  * Fixed bug #986075 (encountering flwor expr with no clauses)
+  * Fixed bug #967864 (var substitution did not update theFreeVars property)
+  * Fixed bug #891650 (context size var not always declared within path expr)
+  * Fixed bug #948879 (--uri-path doesn't work with fetch:content())
+  * Fixed bug in MarkNodeCopyProps rule (static cast to replace_expr without chaing the expr kind first)  
+  * Fixed bug in window iterator (binding the end vars in the output tuple stream)
+  * Fixed bug #866547 (protect index-join rule from general flwor)
+  * Fixed bug #867253 (cdml:delete-nodes should only remove root nodes)
+  * Fixed bug #967428 (do not hoist index creation outside a try-catch)
+  * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)
+  * Fixed bug #966706 (key uniqueness of index not enforced during incremental refresh)
+  * Fixed bug #906494 (default compile with D_FILE_OFFSET_BITS=64)
+  * Fixed bug #988412 (date:current-dateTime daylight saving)
+  * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
+  * Fixed bug #986377 (do not apply any updates on collection if it is to be truncated)
+  * Fixed bug #921458 (file:read-text-lines() blocking)
+  * Fixed bug #981405 (do not hoist expr containing try-catch variables out of the associated try-catch expression)
+  * Fixed bug #996084 (crash in Streamable*Item with file module)
+  * Fixed bug #947627 (throw XQST0099 if more than one declarations of context item type in same module)
+  * Fixed bug #980526 (no-copy rule bug due to global var being set in "distant" udf)
+  * Fixed bug #949910 (has-children may be invoked on all nodes)
+  * Fixed Bug #933490 (Error ItemFactoryImpl::createBase64Binary with istream)
+  * Fixed bug #867112 (Diagnostic Handler was not working on external APIs)
+  * Fixed bug #857842 (Assertion failed with simple content element with comments)
+  * Fixed bug #928626 (no setting classpath in xsl-fo module)
+
+version 2.2
+
+New Features:
+  * Add --compile-plan (-c) and --execute-plan (-e) options to zorba command line.
+  * Add XQuery 3.0 concat operator (http://www.w3.org/TR/xquery-30/#id-string-concat-expr) 
+  * New URI module providing percent-decoding functions.
+  * The core parse-xml module is now able to parse input files in a streaming mode. A number of new options have also been added.
+  * LibXml2 version 2.7.0 or higher is now required in order to build Zorba.  
+  * Added index management function to the C++ api's StaticCollectionManager.
+  * Added createDayTimeDuration, createYearMonthDuration, createDocumentNode, createCommentNode, createPiNode to api's ItemFactory.
+  * Fixed bug #905050 (setting and getting the context item type via the c++ api).
+  * Added split function to the string module that allows for streamable tokenization but doesn't have regular expression
+  * Add new XQuery interface for the PHP bindings.
+  * Added two API methods StaticContext::getFunctions to introspect the functions of a static context
+  * Added API method Item::getNamespaceBindings().
+  * Added a transcoding streambuffer to the API which allows transcoding arbitrary encodings
+    from and to UTF-8
+  * file:read-text is able to handle arbitrary encodings (fixes bug #867159)
+  * http:send-request is able to handle arbitrary encodings
+  * Added API method StaticContext::getNamespaceBindings() (see bug #905035)
+  * New version of the JSON converter module in the core of Zorba (no external dependencies anymore)
+  * Added truncate function to the collection modules for efficient deletion of all nodes in a collection.
+
+
+Optimization:
+  * No-copy optimization: avoids copying nodes during node-constructor expressions.
+  * Added external function annotations %ann:propagates-input-nodes and 
+    %ann:must-copy-input-nodes to be used by the no-copy optimization.
+  * Caching of results for recursive functions with atomic parameter and return types.
+  * Added %ann:cache and %ann:no-cache to enable or disable caching of results of functions with atomic parameter and return types.
+  * Types-related optimizations for runtime operators (comparisons, FnBoolean, Or, And,
+    Compare, instance-of, cast, castable, treat, promote).
+  * More efficient implementation for base64Binary items
+  * Preallocate and reuse temp sequence iterator for LetVarITerator
+    and CtxVarIterator.
+  * Enhanced push-down of positional predicate into LetVarITerator
+    and CtxVarIterator.
+  * Change the implementation of the free-vars annotation and got rid
+    of the annotations map in expressions.
+
+Bug Fixes/Other Changes:
+  * Fixed bug 923015 (clone() not implemented for full-text expressions)
+  * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
+  * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)
+  * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
+  * Fixed bug 909126 (bug in cloning of var_expr)
+  * Fixed bug 928631 (external builtin function were not executed in the module they
+    were declared)
+  * Fixed bug in destruction of exit_catcher_expr
+  * Fixed bug #867024 (error messages)
+  * Fixed bug #957580 (stream read failure in StringToCodepointsIteartor)
+  * Fixed bug #911585 (management of variables during eval)
+  * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in
+    case of early-out)
+  * Fixed bug #955574 (http-client "hangs" if following a POST request)
+  * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)
+  * Fixed bug #872288 (reset recursive flag during node rename)
+  * Fixed bug #905041 (allow for the default element and function namespaces to be
+    set multiple times via the c++ api).
+  * Fixed bug #907872 (segfault when returning an input ItemSequence from an external function).
+  * Fixed bug in codegen: do not create a materialize clause if one exists already
+    support.
+  * Fixed bug involving positional var and groupby 
+  * Fixed bug #867266 (do not hoist updating expressions)
+  * Fixed bug #867022 (added location and params to some XPTY0004 errors)
+  * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
+  * Fixed bug #917981 (disallow declaring same module twice).
+  * Deprecated StaticContext:getNamespaceURIByPrefix()
+  * Fixed bug #943788 (streamable string is not seekable)
+  * Fixed bug #921624 (slow queries with bogus example.com schema URIs)
+  * Fixed bug #918211 (xqueryx fulltext w3c conformance generation)
+  * Fixed bug #918157 (Add XQFTTS to validation queue)
+  * Fixed bug with unversioned modules with C++ external functions
+  * Fixed bug #912579 (validate-in-place on non-root elements)
+  * Fixed bug #891209 (validation with xsi:type returns untyped)
+  * Fixed bug #952829 (Nondeterministic annotation doesn't seem to be checked)
+  * Fixed bug #951772 (Comment node crashes serialization)
+  * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes)
+
+	
+version 2.1
+
+New Features:
+  * New node-position module. This module allows to obtain a representation of a node position, which
+    can be used to assess structural relationships with other nodes.
+  * New node-reference module. References can be obtained for any node, and
+	different nodes cannot have the same identifier.
+  * Custom Full-text thesaurus using Zorba URI resolver mechanism.
+  * Modified C++ API to add isSequential, getExternalVariables, isBoundContextItem and 
+  isBoundExternalVariable Functions
+  * Collection allows to retrieve information about the type
+  and the annotations of a static collection.
+  * Implemented the probe-index-range-value for general indexes
+  * Added ExternalFunctionParameter class to be registered in the DynamicContext
+  * New module for compiling and executing XQueries from XQuery (xqxq)
+  * External functions are allowed to be updating (i.e. return a pending update list)
+
+Optimization:
   * Optimization for positioned sequence access (e.g. $x[$x[1]] where $x is a
   sequence of integers)
-  * documentation improvements
-  * installer improvements
+  * Optimization for count(collection()) expressions
+  * Optimization of the fn:substring function in the case when its $start and $length arguments
+  are integers
+
+Bug Fixes/Other Changes:
   * Fixed bug #3403291 (build for Fedora 15)
   * Fixed bug #3397293 (Incorrect XQueryX error message)
   * Fixed bug #3398637 (Nested element constructors cause loss of namespace bindings)
@@ -15,20 +235,19 @@
   * Fixed bug #3404689 (assignment problem in flwor)
   * Fix for bug #3404450 (testdriver_mt problem: caching and validation of docs)
   * Fixed installation bug to not install the .so for test modules
-  * Fix for running ctest on Windows
   * Fixed bug #3390410 (Adding a node to a collection causes out of bound in vector)
   * Fixed bug #3406200 (node types were not being moved to new tree during node detach)
   * Fixed bug #3406191 (Namespace bindings lost after update due to bug in node detach)
   * Fixed bug #3290122 (ZDST0003 needs collection name)
-  * Collection allows to retrieve information about the type
-  and the annotations of a static collection.
   * Fixed bug #3406272 (merging of adjacent text nodes must be done after all
     updates have been applied).
+  * Don't raise warnings for unknown annotations.
   * Fixed bug #3409344 (during detach, if the node being detached is the root of
     its tree, it should be detached from the tree as well; otherwise memory
     corruption will occur)
-  * Fixed bug # (Should not destroy the parent of a node that is being detached 
-    before the detach is done). 
+  * Fixed bug # (Should not destroy the parent of a node that is being detached
+    before the detach is done).
+  * Added const qualifier to StaticContext::getAuditEvent() 
   * Fixed bug #3408181 (available-collection() returns undeclared collections)
   * Fixed bug #859465 (Fatal error if a PUL contains two deactivate IC primitives)
   * Fixed bug #859467 (Fatal error if a PUL contains two activate Foreign Key primitives)
@@ -36,11 +255,59 @@
   * Fixed bug #859522 (Fatal error if a PUL contains two delete document primitives)
   * Fixed bug #859968 (Using put on an attribute produces an invalid XDM instance and may cause segmentation faults)
   * Fixed bug #855314 (should not fold a constant expr that returns an error item)
-  * Added ExternalFunctionParameter class to be registered in the DynamicContext
+  * Fixed bug when parsing a document with a base-uri attribute.
   * Fixed bug #863320 (Sentence is incorrectly incremented when token characters end without sentence terminator)
   * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
   * Implemented the probe-index-range-value for general indexes
-  * Fixed bug #867662 ("nullptr" warning)
+  * Removed ZSTR0005 and ZSTR0006 error codes
+  * Fixed bug #867662 ("nullptr" warning)
+  * Fixed bug #868258 (Assertion failure with two delete collection)
+  * Fixed bug #871623 and #871629 (assertion failures with insertions in dynamic collections)
+  * Fixed bug #867262 (allow reuse of iterator over ExtFuncArgItemSequence)
+  * Fixed bug #869024 (segmentation fault with node-reference)
+  * Fixed bug #869025 (segmentation fault with node-reference)
+  * New node-reference module. References can be obtained for any node, and
+	different nodes cannot have the same identifier.
+  * Fixed bug #872697  (segmentation fault with validation of NMTOKENS)
+  * General index cannot be declared as unique if the type of its key is
+    xs:anyAtomicType or xs:untypedAtomic.
+  * Added undo for node revalidation
+  * Optimization for count(collection()) expressions
+  * Fixed bug #872796  (validate-in-place can interfere with other update primitives)
+  * Fixed bug #872799 (validate-in-place can set incorrect types)
+  * Fixed bug #855715 (Invalid escaped characters in regex not caught)
+  * Fixed bug #868325 (fn:analyze-string fails with some recursive subgroups)
+  * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
+  * General index cannot be declared as unique if the type of its key is
+  xs:anyAtomicType or xs:untypedAtomic.
+  * Added undo for node revalidation
+  * Optimization for count(collection()) expressions
+  * Fixed bug #867133 (SWIG PHP build failure on Mac OSX)
+  * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
+  * Fixed bug #872799 (validate-in-place can set incorrect types)
+  * Fixed bug #872850 (Serialization of Tumbling Window For fails)
+  * Fixed bug #855715 (Invalid escaped characters in regex not caught)
+  * Fixed bug #862089 (Split binary/xq install directories for modules) by
+  splitting "module path" into separate URI and Library paths
+  * New node-position module. This module allows to obtain a representation of a node position, which
+    can be used to assess structural relationships with other nodes.   
+  * Fixed bug #872502 (validation of the JSON module xqdoc fails)
+  * Fixed bug #897619 (testdriver_mt can not run the XQueryX tests)
+  * Fixed bug #867107 (xqdoc dependency to zorba is wrong)
+  * Fixed bug #897616 (Fix the generation of the XQFTTS report results for
+  W3C)
+
+version 2.0.3
+  * Fixed bug #867662 ("nullptr" warning)
+  * documentation improvements
+
+version 2.0.2
+  * Fixed bug #3401971 (node-by-reference on dynamic collections)
+  * documentation improvements
+  * installer improvements
+  * Fixed bug #3403291 (build for Fedora 15)
+  * Don't install the .so for test modules
+  * Fix for running ctest on Windows
 
 version 2.0.1
 

=== modified file 'KNOWN_ISSUES.txt'
--- KNOWN_ISSUES.txt	2011-10-06 03:41:31 +0000
+++ KNOWN_ISSUES.txt	2012-08-19 03:54:29 +0000
@@ -37,7 +37,7 @@
 * The serializer currently doesn't implement character maps as specified
   (http://www.w3.org/TR/xslt-xquery-serialization/#character-maps)
 
-* In the 2.0 release, setting the CMake variables ZORBA_NO_UNICODE to
+* In the 2.0 release, setting the CMake variables ZORBA_NO_ICU to
   ON is not supported.
 
 * The PHP language binding is not supported on Mac OS X. For details,

=== added file 'NOTICE.txt'
--- NOTICE.txt	1970-01-01 00:00:00 +0000
+++ NOTICE.txt	2012-08-19 03:54:29 +0000
@@ -0,0 +1,740 @@
+-----------
+Zorba 2.6.0
+-----------
+
+(Note: This file is generated automatically from NOTICE.xml.
+Please do not modify this file directly.)
+
+
+
+
+Apache 2
+
+      Copyright 2006-2011 The FLWOR Foundation
+
+      See LICENSE.txt for license information.
+
+      ------------------------
+      This product includes software developed at
+      The FLWOR Foundation (http://www.flworfound.org/).
+
+      ------------------------
+      Portions of this software were developed at the Systems
+      Group of the ETH Zurich, Switzerland.
+    
+
+Other files used by this project:
+----------------------------------------------------
+
+src/zorbatypes/m_apm.h
+src/zorbatypes/mapm/
+
+Copyright: 1999-2007 Michael C. Ring
+Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
+
+      This software is Freeware.
+
+      Permission to use, copy, and distribute this software and its
+      documentation for any purpose with or without fee is hereby granted,
+      provided that the above copyright notice appear in all copies and
+      that both that copyright notice and this permission notice appear
+      in supporting documentation.
+
+      Permission to modify the software is granted. Permission to distribute
+      the modified code is granted. Modifications are to be distributed by
+      using the file 'license.txt' as a template to modify the file header.
+      'license.txt' is available in the official MAPM distribution.
+
+      To distribute modified source code, insert the file 'license.txt'
+      at the top of all modified source code files and edit accordingly.
+
+      This software is provided "as is" without express or implied warranty.
+    
+----------------------------------------------------
+
+src/zorbamisc/config/stdint.h
+
+Copyright: 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.
+    
+----------------------------------------------------
+
+src/zorbautils/stemmer/
+
+Copyright: 2001 Dr. Martin Porter
+
+
+      All the software given out on this Snowball site is covered by the BSD
+      License (see http://www.opensource.org/licenses/bsd-license.html), with
+      Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
+      Copyright (c) 2002, Richard Boulton.
+
+      Essentially, all this means is that you can do what you like with the code,
+      except claim another Copyright for it, or claim that it is issued under a
+      different license. The software is also issued without warranties, which
+      means that if anyone suffers through its use, they cannot come back and sue
+      you. You also have to alert anyone to whom you give the Snowball software to
+      the fact that it is covered by the BSD license.
+
+      We have not bothered to insert the licensing arrangement into the text of
+      the Snowball software.
+    
+----------------------------------------------------
+
+src/util/less.h
+
+Copyright: 1998 Paul J. Lucas
+
+
+      Redistribution and use in source and binary forms, with or without
+      modification, are permitted provided that the following conditions are met:
+
+      o  Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+
+      o  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.
+
+      o  The name of the author may not be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      POSSIBILITY OF SUCH DAMAGE.
+    
+----------------------------------------------------
+
+src/util/auto_vector.h (has been modified)
+
+Copyright: 2003 Reliable Software
+
+
+      Redistribution and use in source and binary forms, with or without
+      modification, are permitted provided that the following conditions are met:
+
+      o  Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+
+      o  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.
+
+      o  The name of the author may not be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      POSSIBILITY OF SUCH DAMAGE.
+    
+----------------------------------------------------
+
+cmake_modules/FindBoost.cmake
+
+Copyright: 
+      2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
+      2007      Wengo
+      2007      Mike Jackson
+      2008      Andreas Pakulat <apaku@xxxxxx>
+    
+
+
+      Redistribution AND use is allowed according to the terms of the New BSD license.
+      For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+    
+----------------------------------------------------
+
+cmake_modules/FindJNI.cmake
+cmake_modules/FindPythonLibs.cmake
+cmake_modules/FindSWIG.cmake
+
+Copyright: 2001-2009 Kitware, Inc.
+
+
+      Distributed under the OSI-approved BSD License (the "License");
+      see accompanying file Copyright.txt for details.
+
+      This software is distributed WITHOUT ANY WARRANTY; without even the
+      implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+      See the License for more information.
+
+      CMake - Cross Platform Makefile Generator
+      Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+      All rights reserved.
+
+      Redistribution and use in source and binary forms, with or without
+      modification, are permitted provided that the following conditions
+      are met:
+
+      * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+      * 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.
+
+      * Neither the names of Kitware, Inc., the Insight Software Consortium,
+      nor the names of their contributors may be used to endorse or promote
+      products derived from this software without specific prior written
+      permission.
+
+      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+      HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+      ------------------------------------------------------------------------------
+
+      The above copyright and license notice applies to distributions of
+      CMake in source and binary form.  Some source files contain additional
+      notices of original copyright by their contributors; see each source
+      for details.  Third-party software packages supplied with CMake under
+      compatible licenses provide their own copyright notices documented in
+      corresponding subdirectories.
+
+      ------------------------------------------------------------------------------
+
+      CMake was initially developed by Kitware with the following sponsorship:
+
+      * National Library of Medicine at the National Institutes of Health
+      as part of the Insight Segmentation and Registration Toolkit (ITK).
+
+      * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
+      Visualization Initiative.
+
+      * National Alliance for Medical Image Computing (NAMIC) is funded by the
+      National Institutes of Health through the NIH Roadmap for Medical Research,
+      Grant U54 EB005149.
+
+      * Kitware, Inc.
+    
+----------------------------------------------------
+
+/xml.xsd
+
+Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+      All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+      W3C Software Notice and License
+
+      This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+      License
+
+      By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+      Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+      •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+      •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+      •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+      Disclaimers
+
+      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+      The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+    
+----------------------------------------------------
+
+schemas/xslt-xquery-serialization.xsd
+
+Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+      All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+      W3C Software Notice and License
+
+      This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+      License
+
+      By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+      Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+      •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+      •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+      •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+      Disclaimers
+
+      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+      The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+    
+----------------------------------------------------
+
+modules/w3c/xpath-functions.xsd
+
+Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
+
+
+      All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
+
+      W3C Software Notice and License
+
+      This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+
+      License
+
+      By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+
+      Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+      •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+      •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+      •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+
+      Disclaimers
+
+      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+      The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+    
+----------------------------------------------------
+
+include/xqc.h
+
+Copyright: 2008, Matthias Brantner, John Snelson
+
+
+      * All rights reserved.
+      *
+      * Redistribution and use in source and binary forms, with or without
+      * modification, are permitted provided that the following conditions are met:
+      *
+      *     * Redistributions of source code must retain the above copyright notice,
+      *       this list of conditions and the following disclaimer.
+      *     * 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.
+      *     * Neither the name of the developers nor the names of contributors may be
+      *       used to endorse or promote products derived from this software without
+      *       specific prior written permission.
+      *
+      * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+      * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+      * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+      * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+      * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+      * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+      * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+      * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+      * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+      * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      * POSSIBILITY OF SUCH DAMAGE.
+    
+----------------------------------------------------
+
+modules/functx/functx.xq
+
+Copyright: 2007 Datypic
+
+
+      : 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.
+
+      : 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
+    
+----------------------------------------------------
+
+src/compiler/parser/FlexLexer.h
+
+Copyright: 1993 The Regents of the University of California
+
+
+      // All rights reserved.
+      //
+      // This code is derived from software contributed to Berkeley by
+      // Kent Williams and Tom Epperly.
+      //
+      //  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.
+
+      //  Neither the name of the University nor the names of its contributors
+      //  may be used to endorse or promote products derived from this software
+      //  without specific prior written permission.
+
+      //  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+      //  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+      //  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+      //  PURPOSE.
+    
+----------------------------------------------------
+
+src/diagnostics/StackWalker.cpp
+src/diagnostics/StackWalker.h
+
+Copyright: 2005 Jochen Kalmbach 
+
+
+      Under BSD License: http://www.opensource.org/licenses/bsd-license.php
+    
+----------------------------------------------------
+
+src/util/singleton.h
+src/util/threads.h
+
+Copyright: 2001 Andrei Alexandrescu
+
+
+      This code accompanies the book:
+      Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
+          Patterns Applied". Copyright (c) 2001. Addison-Wesley.
+      Permission to use, copy, modify, distribute and sell this software for any
+          purpose is hereby granted without fee, provided that the above copyright
+          notice appear in all copies and that both that copyright notice and this
+          permission notice appear in supporting documentation.
+      The author or Addison-Wesley Longman make no representations about the
+          suitability of this software for any purpose. It is provided "as is"
+          without express or implied warranty.
+    
+
+External libraries used by this project:
+----------------------------------------------------
+
+Name: LIBXML2
+Preferred version: 2.2.16 or higher
+Is mandatory: true
+Website: http://xmlsoft.org/
+License: MIT
+Copyright: 1998-2002 Daniel Veillard.  All Rights Reserved.
+External notice: 
+
+      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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+      Except as contained in this notice, the name of Daniel Veillard 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 him.
+    
+----------------------------------------------------
+
+Name: LIBXSLT
+Preferred version: 1.1.26
+Is mandatory: false
+Website: http://xmlsoft.org/XSLT/
+License: MIT
+Copyright: 2001-2002 Daniel Veillard.  All Rights Reserved.
+External notice: 
+
+      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 DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+      Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
+
+    
+----------------------------------------------------
+
+Name: ICU4C
+Preferred version: 3.6 or higher
+Is mandatory: true
+Website: http://www.icu-project.org/
+License: ICU License
+Copyright: 1995-2011 International Business Machines Corporation and others 
+External notice: 
+
+      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, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
+
+      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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+      Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
+    
+----------------------------------------------------
+
+Name: CURL
+Preferred version: above 7.12
+Is mandatory: false
+Website: http://curl.haxx.se/
+License: MIT/X derivate license
+Copyright: 1996 - 2011, Daniel Stenberg, <daniel@xxxxxxx>.
+External notice: 
+
+      All rights reserved.
+
+      Permission to use, copy, modify, and distribute this software for any purpose
+      with or without fee is hereby granted, provided that the above copyright
+      notice and this permission notice appear in all copies.
+
+      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+      NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+      DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+      OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+      OR OTHER DEALINGS IN THE SOFTWARE.
+
+      Except as contained in this notice, the name of a copyright holder shall not
+      be used in advertising or otherwise to promote the sale, use or other dealings
+      in this Software without prior written authorization of the copyright holder.
+    
+----------------------------------------------------
+
+Name: ICONV
+Preferred version: above 1.12
+Is mandatory: true
+Website: http://www.gnu.org/software/libiconv/
+License: LGPL
+Copyright: 1998, 2010 Free Software Foundation, Inc.
+External notice: 
+
+----------------------------------------------------
+
+Name: ZLIB
+Preferred version: 1.2.5
+Is mandatory: true
+Website: http://www.zlib.net/
+Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
+External notice: 
+
+      This software is provided 'as-is', without any express or implied
+      warranty.  In no event will the authors be held liable for any damages
+      arising from the use of this software.
+
+      Permission is granted to anyone to use this software for any purpose,
+      including commercial applications, and to alter it and redistribute it
+      freely, subject to the following restrictions:
+
+      1. The origin of this software must not be misrepresented; you must not
+      claim that you wrote the original software. If you use this software
+      in a product, an acknowledgment in the product documentation would be
+      appreciated but is not required.
+      2. Altered source versions must be plainly marked as such, and must not be
+      misrepresented as being the original software.
+      3. This notice may not be removed or altered from any source distribution.
+
+      Jean-loup Gailly jloup@xxxxxxxx
+      Mark Adler madler@xxxxxxxxxxxxxxxxxx
+    
+----------------------------------------------------
+
+Name: XERCES
+Preferred version: 2.8.0 or higher
+Is mandatory: true
+Website: http://xerces.apache.org/xerces-c/
+License: Apache 2
+Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
+External notice: 
+
+      http://www.apache.org/licenses/LICENSE-2.0
+    
+----------------------------------------------------
+
+Name: BOOST (boost_filesystem)
+Preferred version: 1.32 or higher
+Is mandatory: false
+Website: http://www.boost.org/
+License: Boost Software License v1.0
+Copyright: 
+      Beman Dawes, David Abrahams, 1998-2005.
+      Rene Rivera 2004-2007
+    
+External notice: 
+
+      Permission is hereby granted, free of charge, to any person or organization
+      obtaining a copy of the software and accompanying documentation covered by
+      this license (the "Software") to use, reproduce, display, distribute,
+      execute, and transmit the Software, and to prepare derivative works of the
+      Software, and to permit third-parties to whom the Software is furnished to
+      do so, all subject to the following:
+
+      The copyright notices in the Software and this entire statement, including
+      the above license grant, this restriction and the following disclaimer,
+      must be included in all copies of the Software, in whole or in part, and
+      all derivative works of the Software, unless such copies or derivative
+      works are solely in the form of machine-executable object code generated by
+      a source language processor.
+
+      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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+      SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+      FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+      ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+      DEALINGS IN THE SOFTWARE.
+    
+
+External applications used by this project:
+----------------------------------------------------
+
+Name: FLEX
+Preferred version: 2.5.33
+Is mandatory: false
+Website: http://flex.sourceforge.net/
+Copyright: 
+      2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
+      1990, 1997 The Regents of the University of California. All rights reserved.
+    
+External notice: 
+
+      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.
+      
+      Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+      THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+    
+----------------------------------------------------
+
+Name: BISON
+Preferred version: 2.4 or higher
+Is mandatory: false
+Website: http://www.gnu.org/software/bison/
+License: GPL
+Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+External notice: 
+
+----------------------------------------------------
+
+Name: DOXYGEN
+Preferred version: v1.7.4 
+Is mandatory: false
+Website: www.doxygen.org
+License: GPL
+Copyright: 1997-2011 by Dimitri van Heesch
+External notice: 
+
+      Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
+      No representations are made about the suitability of this software for any purpose. 
+      It is provided "as is" without express or implied warranty. 
+      See the GNU General Public License for more details.
+
+      Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
+    
+----------------------------------------------------
+
+Name: CMAKE
+Preferred version: 2.8.4
+Is mandatory: true
+Website: http://www.cmake.org/
+License: Creative Commons Attribution-NoDerivs 3.0 Unported License
+Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
+External notice: 
+
+      Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+      Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+      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.
+
+      Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+    
+----------------------------------------------------
+
+Name: SWIG
+Preferred version: 2.0.4 or above
+Is mandatory: false
+Website: http://www.swig.org/
+License: GPL
+Copyright: 
+      1995-2011 The SWIG Developers
+      2005-2006 Arizona Board of Regents (University of Arizona).
+      1998-2005 University of Chicago.
+      1995-1998 The University of Utah and the Regents of the University of California
+    
+External notice: 
+
+      SWIG 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. See the LICENSE-GPL file for
+      the full terms of the GNU General Public license version 3.
+
+      Portions of SWIG are also licensed under the terms of the licenses
+      in the file LICENSE-UNIVERSITIES. You must observe the terms of
+      these licenses, as well as the terms of the GNU General Public License,
+      when you distribute SWIG.
+
+      The SWIG library and examples, under the Lib and Examples top level
+      directories, are distributed under the following terms:
+
+      You may copy, modify, distribute, and make derivative works based on
+      this software, in source code or object code form, without
+      restriction. If you distribute the software to others, you may do
+      so according to the terms of your choice. This software is offered as
+      is, without warranty of any kind.
+
+      See the COPYRIGHT file for a list of contributors to SWIG and their
+      copyright notices.
+    
\ No newline at end of file

=== removed file 'NOTICE.txt'
--- NOTICE.txt	2011-09-01 01:58:54 +0000
+++ NOTICE.txt	1970-01-01 00:00:00 +0000
@@ -1,740 +0,0 @@
------------
-Zorba 2.0.1
------------
-
-(Note: This file is generated automatically from NOTICE.xml.
-Please do not modify this file directly.)
-
-
-
-
-Apache 2
-
-      Copyright 2006-2011 The FLWOR Foundation
-
-      See LICENSE.txt for license information.
-
-      ------------------------
-      This product includes software developed at
-      The FLWOR Foundation (http://www.flworfound.org/).
-
-      ------------------------
-      Portions of this software were developed at the Systems
-      Group of the ETH Zurich, Switzerland.
-    
-
-Other files used by this project:
-----------------------------------------------------
-
-src/zorbatypes/m_apm.h
-src/zorbatypes/mapm/
-
-Copyright: 1999-2007 Michael C. Ring
-Website: http://www.tc.umn.edu/~ringx004/mapm-main.html
-
-      This software is Freeware.
-
-      Permission to use, copy, and distribute this software and its
-      documentation for any purpose with or without fee is hereby granted,
-      provided that the above copyright notice appear in all copies and
-      that both that copyright notice and this permission notice appear
-      in supporting documentation.
-
-      Permission to modify the software is granted. Permission to distribute
-      the modified code is granted. Modifications are to be distributed by
-      using the file 'license.txt' as a template to modify the file header.
-      'license.txt' is available in the official MAPM distribution.
-
-      To distribute modified source code, insert the file 'license.txt'
-      at the top of all modified source code files and edit accordingly.
-
-      This software is provided "as is" without express or implied warranty.
-    
-----------------------------------------------------
-
-src/zorbamisc/config/stdint.h
-
-Copyright: 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.
-    
-----------------------------------------------------
-
-src/zorbautils/stemmer/
-
-Copyright: 2001 Dr. Martin Porter
-
-
-      All the software given out on this Snowball site is covered by the BSD
-      License (see http://www.opensource.org/licenses/bsd-license.html), with
-      Copyright (c) 2001, Dr Martin Porter, and (for the Java developments)
-      Copyright (c) 2002, Richard Boulton.
-
-      Essentially, all this means is that you can do what you like with the code,
-      except claim another Copyright for it, or claim that it is issued under a
-      different license. The software is also issued without warranties, which
-      means that if anyone suffers through its use, they cannot come back and sue
-      you. You also have to alert anyone to whom you give the Snowball software to
-      the fact that it is covered by the BSD license.
-
-      We have not bothered to insert the licensing arrangement into the text of
-      the Snowball software.
-    
-----------------------------------------------------
-
-src/util/less.h
-
-Copyright: 1998 Paul J. Lucas
-
-
-      Redistribution and use in source and binary forms, with or without
-      modification, are permitted provided that the following conditions are met:
-
-      o  Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-      o  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.
-
-      o  The name of the author may not be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-      POSSIBILITY OF SUCH DAMAGE.
-    
-----------------------------------------------------
-
-src/util/auto_vector.h (has been modified)
-
-Copyright: 2003 Reliable Software
-
-
-      Redistribution and use in source and binary forms, with or without
-      modification, are permitted provided that the following conditions are met:
-
-      o  Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-      o  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.
-
-      o  The name of the author may not be used to endorse or promote products
-      derived from this software without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-      POSSIBILITY OF SUCH DAMAGE.
-    
-----------------------------------------------------
-
-cmake_modules/FindBoost.cmake
-
-Copyright: 
-      2006-2008 Andreas Schneider <mail@xxxxxxxxxxxx>
-      2007      Wengo
-      2007      Mike Jackson
-      2008      Andreas Pakulat <apaku@xxxxxx>
-    
-
-
-      Redistribution AND use is allowed according to the terms of the New BSD license.
-      For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-    
-----------------------------------------------------
-
-cmake_modules/FindJNI.cmake
-cmake_modules/FindPythonLibs.cmake
-cmake_modules/FindSWIG.cmake
-
-Copyright: 2001-2009 Kitware, Inc.
-
-
-      Distributed under the OSI-approved BSD License (the "License");
-      see accompanying file Copyright.txt for details.
-
-      This software is distributed WITHOUT ANY WARRANTY; without even the
-      implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-      See the License for more information.
-
-      CMake - Cross Platform Makefile Generator
-      Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-      All rights reserved.
-
-      Redistribution and use in source and binary forms, with or without
-      modification, are permitted provided that the following conditions
-      are met:
-
-      * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-
-      * 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.
-
-      * Neither the names of Kitware, Inc., the Insight Software Consortium,
-      nor the names of their contributors may be used to endorse or promote
-      products derived from this software without specific prior written
-      permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-      HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-      ------------------------------------------------------------------------------
-
-      The above copyright and license notice applies to distributions of
-      CMake in source and binary form.  Some source files contain additional
-      notices of original copyright by their contributors; see each source
-      for details.  Third-party software packages supplied with CMake under
-      compatible licenses provide their own copyright notices documented in
-      corresponding subdirectories.
-
-      ------------------------------------------------------------------------------
-
-      CMake was initially developed by Kitware with the following sponsorship:
-
-      * National Library of Medicine at the National Institutes of Health
-      as part of the Insight Segmentation and Registration Toolkit (ITK).
-
-      * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
-      Visualization Initiative.
-
-      * National Alliance for Medical Image Computing (NAMIC) is funded by the
-      National Institutes of Health through the NIH Roadmap for Medical Research,
-      Grant U54 EB005149.
-
-      * Kitware, Inc.
-    
-----------------------------------------------------
-
-/xml.xsd
-
-Copyright: 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
-
-
-      All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
-
-      W3C Software Notice and License
-
-      This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
-
-      License
-
-      By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
-
-      Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
-      •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
-      •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
-      •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
-      Disclaimers
-
-      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-      The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-    
-----------------------------------------------------
-
-schemas/xslt-xquery-serialization.xsd
-
-Copyright: 2010 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
-
-
-      All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
-
-      W3C Software Notice and License
-
-      This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
-
-      License
-
-      By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
-
-      Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
-      •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
-      •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
-      •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
-      Disclaimers
-
-      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-      The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-    
-----------------------------------------------------
-
-modules/w3c/xpath-functions.xsd
-
-Copyright: 2005 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University)
-
-
-      All Rights Reserved. This work is distributed under the W3C Software License [1] 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.
-
-      W3C Software Notice and License
-
-      This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
-
-      License
-
-      By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
-
-      Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
-      •The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
-      •Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
-      •Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
-
-      Disclaimers
-
-      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
-
-      The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-    
-----------------------------------------------------
-
-include/xqc.h
-
-Copyright: 2008, Matthias Brantner, John Snelson
-
-
-      * All rights reserved.
-      *
-      * Redistribution and use in source and binary forms, with or without
-      * modification, are permitted provided that the following conditions are met:
-      *
-      *     * Redistributions of source code must retain the above copyright notice,
-      *       this list of conditions and the following disclaimer.
-      *     * 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.
-      *     * Neither the name of the developers nor the names of contributors may be
-      *       used to endorse or promote products derived from this software without
-      *       specific prior written permission.
-      *
-      * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-      * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-      * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-      * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-      * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-      * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-      * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-      * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-      * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-      * POSSIBILITY OF SUCH DAMAGE.
-    
-----------------------------------------------------
-
-modules/functx/functx.xq
-
-Copyright: 2007 Datypic
-
-
-      : 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.
-
-      : 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
-    
-----------------------------------------------------
-
-src/compiler/parser/FlexLexer.h
-
-Copyright: 1993 The Regents of the University of California
-
-
-      // All rights reserved.
-      //
-      // This code is derived from software contributed to Berkeley by
-      // Kent Williams and Tom Epperly.
-      //
-      //  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.
-
-      //  Neither the name of the University nor the names of its contributors
-      //  may be used to endorse or promote products derived from this software
-      //  without specific prior written permission.
-
-      //  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-      //  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-      //  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-      //  PURPOSE.
-    
-----------------------------------------------------
-
-src/diagnostics/StackWalker.cpp
-src/diagnostics/StackWalker.h
-
-Copyright: 2005 Jochen Kalmbach 
-
-
-      Under BSD License: http://www.opensource.org/licenses/bsd-license.php
-    
-----------------------------------------------------
-
-src/util/singleton.h
-src/util/threads.h
-
-Copyright: 2001 Andrei Alexandrescu
-
-
-      This code accompanies the book:
-      Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
-          Patterns Applied". Copyright (c) 2001. Addison-Wesley.
-      Permission to use, copy, modify, distribute and sell this software for any
-          purpose is hereby granted without fee, provided that the above copyright
-          notice appear in all copies and that both that copyright notice and this
-          permission notice appear in supporting documentation.
-      The author or Addison-Wesley Longman make no representations about the
-          suitability of this software for any purpose. It is provided "as is"
-          without express or implied warranty.
-    
-
-External libraries used by this project:
-----------------------------------------------------
-
-Name: LIBXML2
-Preferred version: 2.2.16 or higher
-Is mandatory: true
-Website: http://xmlsoft.org/
-License: MIT
-Copyright: 1998-2002 Daniel Veillard.  All Rights Reserved.
-External notice: 
-
-      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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-      Except as contained in this notice, the name of Daniel Veillard 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 him.
-    
-----------------------------------------------------
-
-Name: LIBXSLT
-Preferred version: 1.1.26
-Is mandatory: false
-Website: http://xmlsoft.org/XSLT/
-License: MIT
-Copyright: 2001-2002 Daniel Veillard.  All Rights Reserved.
-External notice: 
-
-      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 DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-      Except as contained in this notice, the name of Daniel Veillard shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from him.
-
-    
-----------------------------------------------------
-
-Name: ICU4C
-Preferred version: 3.6 or higher
-Is mandatory: true
-Website: http://www.icu-project.org/
-License: ICU License
-Copyright: 1995-2011 International Business Machines Corporation and others 
-External notice: 
-
-      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, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
-
-      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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-      Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
-    
-----------------------------------------------------
-
-Name: CURL
-Preferred version: above 7.12
-Is mandatory: false
-Website: http://curl.haxx.se/
-License: MIT/X derivate license
-Copyright: 1996 - 2011, Daniel Stenberg, <daniel@xxxxxxx>.
-External notice: 
-
-      All rights reserved.
-
-      Permission to use, copy, modify, and distribute this software for any purpose
-      with or without fee is hereby granted, provided that the above copyright
-      notice and this permission notice appear in all copies.
-
-      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
-      NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-      DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-      OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-      OR OTHER DEALINGS IN THE SOFTWARE.
-
-      Except as contained in this notice, the name of a copyright holder shall not
-      be used in advertising or otherwise to promote the sale, use or other dealings
-      in this Software without prior written authorization of the copyright holder.
-    
-----------------------------------------------------
-
-Name: ICONV
-Preferred version: above 1.12
-Is mandatory: true
-Website: http://www.gnu.org/software/libiconv/
-License: LGPL
-Copyright: 1998, 2010 Free Software Foundation, Inc.
-External notice: 
-
-----------------------------------------------------
-
-Name: ZLIB
-Preferred version: 1.2.5
-Is mandatory: true
-Website: http://www.zlib.net/
-Copyright: 1995-2004 Jean-loup Gailly and Mark Adler
-External notice: 
-
-      This software is provided 'as-is', without any express or implied
-      warranty.  In no event will the authors be held liable for any damages
-      arising from the use of this software.
-
-      Permission is granted to anyone to use this software for any purpose,
-      including commercial applications, and to alter it and redistribute it
-      freely, subject to the following restrictions:
-
-      1. The origin of this software must not be misrepresented; you must not
-      claim that you wrote the original software. If you use this software
-      in a product, an acknowledgment in the product documentation would be
-      appreciated but is not required.
-      2. Altered source versions must be plainly marked as such, and must not be
-      misrepresented as being the original software.
-      3. This notice may not be removed or altered from any source distribution.
-
-      Jean-loup Gailly jloup@xxxxxxxx
-      Mark Adler madler@xxxxxxxxxxxxxxxxxx
-    
-----------------------------------------------------
-
-Name: XERCES
-Preferred version: 2.8.0 or higher
-Is mandatory: true
-Website: http://xerces.apache.org/xerces-c/
-License: Apache 2
-Copyright: Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.
-External notice: 
-
-      http://www.apache.org/licenses/LICENSE-2.0
-    
-----------------------------------------------------
-
-Name: BOOST (boost_filesystem)
-Preferred version: 1.32 or higher
-Is mandatory: false
-Website: http://www.boost.org/
-License: Boost Software License v1.0
-Copyright: 
-      Beman Dawes, David Abrahams, 1998-2005.
-      Rene Rivera 2004-2007
-    
-External notice: 
-
-      Permission is hereby granted, free of charge, to any person or organization
-      obtaining a copy of the software and accompanying documentation covered by
-      this license (the "Software") to use, reproduce, display, distribute,
-      execute, and transmit the Software, and to prepare derivative works of the
-      Software, and to permit third-parties to whom the Software is furnished to
-      do so, all subject to the following:
-
-      The copyright notices in the Software and this entire statement, including
-      the above license grant, this restriction and the following disclaimer,
-      must be included in all copies of the Software, in whole or in part, and
-      all derivative works of the Software, unless such copies or derivative
-      works are solely in the form of machine-executable object code generated by
-      a source language processor.
-
-      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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-      SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-      FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-      ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-      DEALINGS IN THE SOFTWARE.
-    
-
-External applications used by this project:
-----------------------------------------------------
-
-Name: FLEX
-Preferred version: 2.5.33
-Is mandatory: false
-Website: http://flex.sourceforge.net/
-Copyright: 
-      2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The Flex Project.
-      1990, 1997 The Regents of the University of California. All rights reserved.
-    
-External notice: 
-
-      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.
-      
-      Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-    
-----------------------------------------------------
-
-Name: BISON
-Preferred version: 2.4 or higher
-Is mandatory: false
-Website: http://www.gnu.org/software/bison/
-License: GPL
-Copyright: 1998, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-External notice: 
-
-----------------------------------------------------
-
-Name: DOXYGEN
-Preferred version: v1.7.4 
-Is mandatory: false
-Website: www.doxygen.org
-License: GPL
-Copyright: 1997-2011 by Dimitri van Heesch
-External notice: 
-
-      Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted.
-      No representations are made about the suitability of this software for any purpose. 
-      It is provided "as is" without express or implied warranty. 
-      See the GNU General Public License for more details.
-
-      Documents produced by doxygen are derivative works derived from the input used in their production; they are not affected by this license.
-    
-----------------------------------------------------
-
-Name: CMAKE
-Preferred version: 2.8.4
-Is mandatory: true
-Website: http://www.cmake.org/
-License: Creative Commons Attribution-NoDerivs 3.0 Unported License
-Copyright: 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
-External notice: 
-
-      Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-      Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-      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.
-
-      Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-    
-----------------------------------------------------
-
-Name: SWIG
-Preferred version: 2.0.4 or above
-Is mandatory: false
-Website: http://www.swig.org/
-License: GPL
-Copyright: 
-      1995-2011 The SWIG Developers
-      2005-2006 Arizona Board of Regents (University of Arizona).
-      1998-2005 University of Chicago.
-      1995-1998 The University of Utah and the Regents of the University of California
-    
-External notice: 
-
-      SWIG 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. See the LICENSE-GPL file for
-      the full terms of the GNU General Public license version 3.
-
-      Portions of SWIG are also licensed under the terms of the licenses
-      in the file LICENSE-UNIVERSITIES. You must observe the terms of
-      these licenses, as well as the terms of the GNU General Public License,
-      when you distribute SWIG.
-
-      The SWIG library and examples, under the Lib and Examples top level
-      directories, are distributed under the following terms:
-
-      You may copy, modify, distribute, and make derivative works based on
-      this software, in source code or object code form, without
-      restriction. If you distribute the software to others, you may do
-      so according to the terms of your choice. This software is offered as
-      is, without warranty of any kind.
-
-      See the COPYRIGHT file for a list of contributors to SWIG and their
-      copyright notices.
-    
\ No newline at end of file

=== modified file 'README.txt'
--- README.txt	2011-10-05 07:54:00 +0000
+++ README.txt	2012-08-19 03:54:29 +0000
@@ -11,7 +11,7 @@
   -------------
 
   The documentation is included in the doc directory, as well as 
-  on the website of the project at http://www.zorba-xquery.com/doc/zorba-latest/zorba/html/.
+  on the website of the project at http://www.zorba-xquery.org/html/documentation
 
   Build & Installation
   --------------------
@@ -45,4 +45,4 @@
   https://bugs.launchpad.net/zorba.
 
   o If you want to participate in actively developing Zorba or
-  support Zorba, please write a mail to: zorba-coders@xxxxxxxxxxxxxxxxx.
+  support Zorba, please write a mail to: zorba-dev@xxxxxxxxxxxxxxxx

=== modified file 'bin/CMakeLists.txt'
--- bin/CMakeLists.txt	2011-08-05 02:21:55 +0000
+++ bin/CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -15,33 +15,38 @@
 INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/src/)
 INCLUDE_DIRECTORIES(AFTER ${CMAKE_CURRENT_SOURCE_DIR})
 
-IF(ZORBA_WITH_DEBUGGER_CLIENT)
-  CONFIGURE_FILE (debug_client/event_handler_init.cpp.in debug_client/event_handler_init.cpp)
-  
-  SET(DEBUG_CLIENT_SRCS
-      debug_client/tuple.h
-      debug_client/main.cpp
-      debug_client/debug_command.h
-      debug_client/debug_command.cpp
-      debug_client/command_line_handler.h
-      debug_client/command_line_handler.cpp
-      debug_client/lock_free_queue.h
-      debug_client/event_handler.h
-      debug_client/event_handler.cpp
-      ${CMAKE_CURRENT_BINARY_DIR}/debug_client/event_handler_init.cpp
+IF (ZORBA_WITH_DEBUGGER)
+  IF (NOT WIN32)
+    FIND_PACKAGE (Libedit)
+    IF (LIBEDIT_FOUND)
+      INCLUDE_DIRECTORIES (${LIBEDIT_INCLUDE_DIRS})
+      SET (LIBEDIT_LIBS ${LIBEDIT_LIBRARIES})
+      SET (ZORBA_HAVE_LIBEDIT_H ${LIBEDIT_FOUND})
+    ENDIF (LIBEDIT_FOUND)
+  ENDIF (NOT WIN32)
+
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h)
+  MESSAGE(STATUS "configured ${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake --> ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h")
+  INCLUDE_DIRECTORIES (BEFORE ${CMAKE_CURRENT_BINARY_DIR}/debugger)
+
+  SET (DEBUG_CLIENT_SRCS
+    debugger/main.cpp
+    debugger/xqdb_client.cpp
+    debugger/process_listener.cpp
+    debugger/command_prompt.cpp
+    debugger/command_line_handler.cpp
+    debugger/event_handler.cpp
   )
   
-  CONFIGURE_FILE (debug_client/message-handler.xq message-handler.xq)
-  
-  ZORBA_GENERATE_EXE("debuggercmd" "${DEBUG_CLIENT_SRCS}" "" "debugger" "bin")
-ENDIF(ZORBA_WITH_DEBUGGER_CLIENT)
+  ZORBA_GENERATE_EXE ("xqdb" "${DEBUG_CLIENT_SRCS}" "${LIBEDIT_LIBS}" "xqdb" "bin")
+ENDIF (ZORBA_WITH_DEBUGGER)
 
 SET(SRCS
   zorbacmd.cpp
   zorbacmdproperties.cpp
   error_printer.cpp
   util.cpp
-  module_path.cpp
+  path_util.cpp
 )
 
 INCLUDE("${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake")
@@ -84,3 +89,37 @@
 # test the --option option to set an option in the static context
 ZORBA_ADD_TEST(bin/zorba_option zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/option.xq" -f --option "{http://www.zorba-xquery.com}option=value";)
 ZORBA_SET_TEST_PROPERTY(bin/zorba_option PASS_REGULAR_EXPRESSION "value")
+
+# test the --uri-path, --lib-path, and --module-path args.
+# Use the versioning tests as they utilize test modules already.
+SET (_testdir
+  "${CMAKE_CURRENT_SOURCE_DIR}/../test/rbkt/Queries/zorba/versioning")
+SET (_uridir "${CMAKE_BINARY_DIR}/TEST_URI_PATH")
+SET (_libdir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH")
+ZORBA_ADD_TEST(bin/zorba_uri_path_1 zorbacmd -f -q "${_testdir}/import1.xq"
+  --uri-path "${_uridir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_1
+  PASS_REGULAR_EXPRESSION "hello, v2")
+
+ZORBA_ADD_TEST(bin/zorba_uri_path_2 zorbacmd -f -q "${_testdir}/external1.xq"
+  --uri-path "${_uridir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_2
+  PASS_REGULAR_EXPRESSION "ZXQP0008")
+
+ZORBA_ADD_TEST(bin/zorba_uri_path_3 zorbacmd -f -q "${_testdir}/external1.xq"
+  --uri-path "${_uridir}" --lib-path "${_libdir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_3
+  PASS_REGULAR_EXPRESSION "hello, v2")
+
+IF(WIN32)
+  SET(PATH_SEP ";")
+ELSE(WIN32)
+  SET(PATH_SEP ":")
+ENDIF(WIN32)
+ZORBA_ADD_TEST(bin/zorba_module_path_1 zorbacmd -f -q "${_testdir}/external1.xq"
+  --module-path "${_libdir}${PATH_SEP}${_uridir}")
+ZORBA_SET_TEST_PROPERTY(bin/zorba_module_path_1
+  PASS_REGULAR_EXPRESSION "hello, v2")
+
+# test compilation of the perf script
+ZORBA_ADD_TEST(bin/zorba_compilechk4 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/../test/zperf/src/start.xq" -f --compile-only)

=== removed file 'bin/debug_client/debug_command.cpp'
--- bin/debug_client/debug_command.cpp	2011-07-01 01:53:24 +0000
+++ bin/debug_client/debug_command.cpp	1970-01-01 00:00:00 +0000
@@ -1,99 +0,0 @@
-/*
- * 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.
- */
-#include <iostream>
-#include "debug_client/debug_command.h"
-
-namespace zorba { namespace debugclient {
-  
-  
-  void CommandLine::execute()
-  {
-    for (;;) {
-      std::cout << "zdb>> ";
-      std::string command;
-      std::getline(std::cin, command);
-      std::vector<std::string> args;
-      args << command;
-      std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.find(args[0]);
-      if (lIter == theCommands.end()) {
-        std::cout << args[0] << ": Command not found" << std::endl;
-        continue;
-      }
-      if (!lIter->second->execute(args))
-        continue;
-      return;
-    }
-  }
-  
-  
-  CommandLine::~CommandLine()
-  {
-    for (std::map<std::string, UntypedCommand*>::iterator i = theCommands.begin();
-         i != theCommands.end(); ++i)
-    {
-      delete i->second;
-    }
-  }
-  
-  CommandLine& CommandLine::operator<<(UntypedCommand *aCommand)
-  {
-    theCommands.insert(std::make_pair(aCommand->get_name(), aCommand));
-    return *this;
-  }
-}}
-
-namespace std {
-  vector<string>& operator<< (vector<string>& vec, const string& str)
-  {
-    string::size_type before = 0;
-    string::size_type pos = str.find(" ", 0);
-    while (pos != str.npos) {
-      std::string lSub = str.substr(before, pos - before);
-      if (lSub[0] == '"') {
-        std::string::size_type lBeforeCopy = before;
-        do {
-          lBeforeCopy = str.find("\"", lBeforeCopy + 1);
-        } while (pos != str.npos && str.size() > pos + 1 && str[pos + 1] == '\\');
-        pos = lBeforeCopy;
-        lSub = str.substr(before + 1, pos - before - 1);
-      }
-      vec.push_back(lSub);
-      before = pos + 1;
-      pos = str.find(" ", before);
-    }
-    std::string lSub = str.substr(before);
-    if (lSub[0] == '"') {
-      pos = str.find("\"", before + 1);
-      lSub = str.substr(before + 1, pos - before - 1);
-    }
-    vec.push_back(lSub);
-    return vec;
-  }
-  
-  set<string>& operator<< (set<string>& vec, const string& str)
-  {
-    string::size_type before = 0;
-    string::size_type pos = str.find(" ", 0);
-    while (pos != str.npos) {
-      vec.insert(str.substr(before, pos));
-      before = pos + 1;
-      pos = str.find(" ", before);
-    }
-    vec.insert(str.substr(before));
-    return vec;
-  }
-
-}

=== removed file 'bin/debug_client/event_handler_init.cpp.in'
--- bin/debug_client/event_handler_init.cpp.in	2011-07-01 01:53:24 +0000
+++ bin/debug_client/event_handler_init.cpp.in	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-#include <fstream>
-#include "debug_client/event_handler.h"
-
-namespace zorba { namespace debugclient {
-
-  std::istream* EventHandler::getCurrentDirectory() {
-    const char* build_dir = "@CMAKE_BINARY_DIR@/bin/message-handler.xq";
-    const char* install_dir = 
-#ifndef WIN32
-    "@CMAKE_INSTALL_PREFIX@/bin/";
-#else
-    "C:/Program Files/Zorba XQuery Processor @ZORBA_MAJOR_NUMBER@.@ZORBA_MINOR_NUMBER@.@ZORBA_PATCH_NUMBER@/bin/";
-#endif
-    std::auto_ptr<std::ifstream> stream(new std::ifstream(build_dir));
-    if (stream->good()) {
-      return stream.release();
-    }
-    stream.reset(new std::ifstream(install_dir));
-    if (stream->good()) {
-      return stream.release();
-    }
-    return 0;
-  }
-
-}} // end of namespace zorba::debugclient
-

=== removed file 'bin/debug_client/lock_free_queue.cpp'
--- bin/debug_client/lock_free_queue.cpp	2011-07-01 01:53:24 +0000
+++ bin/debug_client/lock_free_queue.cpp	1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
-/*
- * 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.
- */
-#include "lock_free_queue.h"

=== removed file 'bin/debug_client/message-handler.xq'
--- bin/debug_client/message-handler.xq	2011-08-26 23:36:24 +0000
+++ bin/debug_client/message-handler.xq	1970-01-01 00:00:00 +0000
@@ -1,165 +0,0 @@
-(:
- : Copyright 2006-2009 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.
-:)
-
-import module namespace refl = 'http://www.zorba-xquery.com/modules/reflection';
-import module namespace sctx = "http://www.zorba-xquery.com/modules/introspection/sctx";;
-import module namespace base64 = "http://www.zorba-xquery.com/modules/converters/base64";;
-
-
-declare variable $local:localns as xs:string := 'http://www.w3.org/2005/xquery-local-functions';
-
-
-declare variable $local:endl as xs:string := '
-';
-
-declare function local:has-to-stop($resp as element())
-{
-  fn:not(($resp/@command/data(.) eq "stop" and $resp/@reason/data(.) eq "ok")
-    or ($resp/@status/data(.) eq "stopped")
-    or ($resp/@status/data(.) eq "stopping"))
-};
-
-declare function local:status($resp as element())
-{
-  fn:concat(
-    "Status: ", $resp/@status/data(.), $local:endl,
-    "Reason: ", $resp/@reason/data(.), $local:endl,
-    let $msg := $resp/text()
-    return
-      if (fn:empty($msg) or $msg eq "") then
-        ""
-      else
-        fn:concat($msg, $local:endl)
-  )
-};
-
-
-declare function local:run($resp as element()) {
-  if ($resp/@status/data(.) eq "starting") then
-    "Starting query"
-  else
-    local:status($resp)
-};
-
-declare function local:stop($resp as element())
-{
-  local:status($resp)
-};
-
-declare function local:breakpoint_set($resp as element())
-{
-  if ($resp/error) then
-    fn:concat("Error when setting a breakpoint: ", if ($resp/error/message) then $resp/error/message/text() else concat(" errcode: ", data($resp/error/@code)))
-  else
-    fn:concat("set breakpoint with id ", data($resp/@id), " and state ", data($resp/@state))
-};
-
-declare function local:breakpoint_list($resp as element())
-{
-  string-join(
-    for $b in $resp/breakpoint
-    return concat("Breakpoint ", data($b/@id), " at ", data($b/@filename), ":", data($b/@lineno), " ", data($b/@state)),
-    $local:endl
-  )
-};
-
-declare function local:breakpoint_remove($resp as element())
-{
-  "Breakpoint removed"
-};
-
-declare function local:stack_depth($resp as element())
-{
-  concat("Depth: ", data($resp/@depth))
-};
-
-declare function local:stack_get($resp as element())
-{
-  string-join(
-    for $s in $resp/stack
-    return concat("Level ", data($s/@level), " at ", data($s/@filename), ":", data($s/@lineno)),
-    $local:endl
-  )
-};
-
-
-declare function local:context_names($resp as element())
-{
-  string-join(
-    for $c in $resp/context
-    return concat("Context: ", data($c/@name), " id: ", data($c/@id)),
-    $local:endl
-  )
-};
-
-declare function local:context_get($resp as element())
-{
-  string-join(
-    for $p in $resp/property
-    return concat(data($p/@fullname), ": [", data($p/@type), "]",
-                  if ($p/text() ne "") then concat(": ", base64:decode($p/text())) else ""),
-    $local:endl
-  )
-};
-
-declare function local:eval($resp as element())
-{
-  if (data($resp/@success) eq "1") then
-    local:context_get($resp)
-  else
-    concat("Eval failed", ":", $resp/error/message/text())
-};
-
-declare function local:process-response($resp as element())
-{
-  if (data($resp/@command) eq "") then
-    (fn:true(), $resp/@transaction_id/data(.), local:status($resp))
-  else
-    let $fun-cont-name := fn:QName($local:localns, concat("local:", $resp/@command/data(.), "-cont"))
-    let $fun-msg-name := fn:QName($local:localns, concat("local:", $resp/@command/data(.)))
-    return (
-      if (sctx:function-arguments-count($fun-cont-name) = 1) then
-        refl:invoke($fun-cont-name, $resp)
-      else
-        local:has-to-stop($resp),
-      $resp/@transaction_id/data(.),
-      if (sctx:function-arguments-count($fun-msg-name) = 1) then
-        refl:invoke($fun-msg-name, $resp)
-      else
-        "Recieved a message - command not implemented"
-    )
-};
-
-declare function local:process-init($init as element())
-{
-  fn:true(),
-  0,
-  fn:concat(fn:string-join(
-  ('Established connection with', $init/@language/data(.), 'client', $init/@appid/data(.)), ' '), '
-')
-};
-
-declare function local:main($response as element()) {
-  let $process-fun as xs:QName := fn:QName($local:localns, concat("local:process-", node-name($response)))
-  return
-    if (sctx:function-arguments-count($process-fun) = 1) then
-      refl:invoke($process-fun, $response)
-    else (
-          true(),
-          ($response/@transaction_id, 0)[1]/data(.),
-          "ERROR: Recieved unknown node from client"
-         )
-};

=== renamed directory 'bin/debug_client' => 'bin/debugger'
=== renamed file 'bin/debug_client/debug_command.h' => 'bin/debugger/command.h'
--- bin/debug_client/debug_command.h	2011-07-04 08:05:46 +0000
+++ bin/debugger/command.h	2012-08-19 03:54:29 +0000
@@ -14,7 +14,9 @@
  * limitations under the License.
  */
 #pragma once
-#include <zorba/config.h>
+#ifndef ZORBA_DEBUGGER_COMMAND_H
+#define ZORBA_DEBUGGER_COMMAND_H
+
 #include <string>
 #include <vector>
 #include <iostream>
@@ -23,151 +25,18 @@
 #include <sstream>
 #include <memory>
 #include <typeinfo>
-#include "debug_client/tuple.h"
-
-namespace zorba { namespace debugclient {
+
+#include <zorba/config.h>
+
+#include "command_arg.h"
+#include "tuple.h"
+
+
+namespace zorba { namespace debugger {
   
   class DebugClientParseException : public std::exception {
   };
   
-  template<typename Tuple>
-  class CommandArg;
-  
-  template<typename Tuple>
-  class CommandArgInstance {
-  public:
-    virtual int get_index() const = 0;
-    virtual const CommandArg<Tuple>* get_arg() const = 0;
-    virtual void insertValue(Tuple& t) = 0;
-    virtual bool isSet(Tuple& t) const = 0;
-  };
-  
-  template<typename T, int Idx, typename Tuple>
-  class TypedCommandArgInstance : public CommandArgInstance<Tuple>
-  {
-  public:
-    TypedCommandArgInstance(T aValue, const CommandArg<Tuple>* aArg)
-    : theValue(aValue), theArg(aArg) {}
-    virtual int get_index() const { return Idx; }
-    virtual const CommandArg<Tuple>* get_arg() const { return theArg; }
-    virtual void insertValue(Tuple& t)
-    {
-      ZORBA_TR1_NS::get<Idx>(t).first = true;
-      ZORBA_TR1_NS::get<Idx>(t).second = theValue;
-    }
-    virtual bool isSet(Tuple& t) const
-    {
-      return ZORBA_TR1_NS::get<Idx>(t).first;
-    }
-  private:
-    T theValue;
-    const CommandArg<Tuple>* theArg;
-  };
-  
-  template<typename Tuple>
-  class CommandArgType {
-  public:
-    virtual CommandArgInstance<Tuple>* parse(const std::string& str,
-                                             const CommandArg<Tuple>* arg) = 0;
-    virtual bool isVoid() const = 0;
-    virtual bool isSet(Tuple& t) const = 0;
-    virtual ~CommandArgType() {}
-  };
-  
-  template<typename T, int Idx, typename Tuple>
-  class TypedCommandArgType : public CommandArgType<Tuple> {
-  public:
-    typedef T Type;
-  public: // implementation
-    TypedCommandArgType(bool aIsVoid) : theIsVoid(aIsVoid) {}
-    TypedCommandArgType(const T& aValue,
-                        bool aIsVoid)
-    : theDefault(aValue), theIsVoid(aIsVoid) {}
-    virtual CommandArgInstance<Tuple>* parse(const std::string& str,
-                                             const CommandArg<Tuple>* arg)
-    {
-      T aValue;
-      std::stringstream stream(str);
-      stream >> aValue;
-      if (stream.fail()) {
-        std::cerr << "Could not parse argument of type "
-          << typeid(T).name()
-          << std::endl;
-        return 0;
-      }
-      return new TypedCommandArgInstance<T, Idx, Tuple>(aValue, arg);
-    }
-    virtual bool isVoid() const { return theIsVoid; }
-    virtual bool isSet(Tuple& t) const
-    {
-      return ZORBA_TR1_NS::get<Idx>(t).first;
-    }
-  private:
-    TypedCommandArgType<T, Idx, Tuple>() {}
-    T theDefault;
-    bool theIsVoid;
-  };
-
-  template<typename Tuple>
-  class CommandArg {
-  public:
-    CommandArg(unsigned aId,
-               CommandArgType<Tuple>* aType,
-               const std::set<std::string>& aFlags,
-               const std::string& aDescription,
-               bool aIsRequired)
-    : theId(aId),
-    theType(aType),
-    theFlags(aFlags),
-    theDescription(aDescription),
-    theIsRequired(aIsRequired)
-    {
-    }
-    ~CommandArg() { delete theType; }
-    unsigned get_id() const { return theId; }
-    bool canHandle(const std::string& arg) const
-    {
-      if (theFlags.find(arg) != theFlags.end()) {
-        return true;
-      }
-      return false;
-    }
-    CommandArgInstance<Tuple>* parse(const std::string& str) const
-    {
-      return theType->parse(str, this);
-    }
-    bool isVoid() const {
-      return theType->isVoid();
-    }
-    bool isRequired() const { return theIsRequired; }
-    std::string get_name() const {
-      return *(theFlags.begin());
-    }
-    bool isSet(Tuple& t) const
-    {
-      return theType->isSet(t);
-    }
-  private:
-    unsigned theId;
-    CommandArgType<Tuple>* theType;
-    std::set<std::string> theFlags;
-    std::string theDescription;
-    bool theIsRequired;
-  };
-}} // end namespace zorba
-
-namespace std {
-  
-  /**
-   * This is a helper split function
-   */
-  vector<string>& operator<< (vector<string>& vec, const string& str);
-  
-  set<string>& operator<< (set<string>& vec, const string& str);
-} //end namespace std
-
-namespace zorba { namespace debugclient {
-
   template<typename Func, typename Tuple, int CommandIdx>
   class CommandInstance
   {
@@ -188,8 +57,11 @@
   
   class UntypedCommand {
   public:
-    virtual std::string get_name() const = 0;
-    virtual std::string get_description() const = 0;
+    virtual ~UntypedCommand() {}
+    virtual std::string getName() const = 0;
+    virtual std::set<std::string> getAliases() const = 0;
+    virtual std::string getDescription() const = 0;
+    virtual void printHelp() const = 0;
     virtual bool execute(const std::vector<std::string>& args) = 0;
   };
   
@@ -197,77 +69,141 @@
   class Command : public UntypedCommand {
   public:
     Command(const std::string& aName, Func& aFunction, const std::string& aDescription)
-      : theName(aName), theFunction(aFunction), theDescription(aDescription) {}
+      : theName(aName), theFunction(aFunction), theDescription(aDescription)
+    {}
+
+    Command(const std::string& aName, const std::set<std::string> aAliases, Func& aFunction, const std::string& aDescription)
+      : theName(aName), theAliases(aAliases), theFunction(aFunction), theDescription(aDescription)
+    {}
+
     ~Command();
+
   public:
-    Command& operator() (unsigned aId,
-                         const std::string& aFlags,
-                         CommandArgType<Tuple>* aType,
-                         const std::string& aDescription = "",
-                         bool isRequired = false);
-    virtual std::string get_name() const { return theName; }
-    virtual std::string get_description() const { return theDescription; }
+
+    void
+    addArgument(
+      unsigned aId,
+      const std::string& aFlags,
+      CommandArgType<Tuple>* aType,
+      const std::string& aDescription = "",
+      bool isRequired = false);
+
+    static void
+    splitNames(
+      const std::string& names,
+      std::set<std::string>& set);
+
+    virtual std::string
+    getName() const
+    {
+      return theName;
+    }
+
+    virtual std::set<std::string> getAliases() const
+    {
+      return theAliases;
+    }
+
+    virtual std::string
+    getDescription() const
+    {
+      return theDescription;
+    }
+
+    virtual void
+    printHelp() const;
+
     virtual bool execute(const std::vector<std::string>& args)
     {
       CommandInstance<Func, Tuple, CommandIdx> instance(theFunction, theTuple);
-      if (instance.parseArguments(args, theArgs))
+      if (instance.parseArguments(args, theArgs)) {
         instance.execute();
-      else
-        return false;
-      return true;
+        return true;
+      }
+      return false;
     }
   private:
     std::string theName;
+    std::set<std::string> theAliases;
     Func& theFunction;
     Tuple theTuple;
     std::string theDescription;
-    std::map<std::string, CommandArg<Tuple>* > theArgs;
-  };
-  
-  class CommandLine {
-  public:
-    ~CommandLine();
-  public:
-    void execute();
-    CommandLine& operator<< (UntypedCommand* aCommand);
-  private:
-    std::map<std::string, UntypedCommand*> theCommands;
-  };
-  
-  template<typename Func, typename Tuple, int CommandIdx>
-  Command<Func, Tuple, CommandIdx>::~Command()
-  {
-    typedef std::map<std::string, CommandArg<Tuple>* > ArgType;
-    for (typename ArgType::iterator i = theArgs.begin(); i != theArgs.end(); ++i) {
-      delete i->second;
-    }
-  }
-    
- 
-  template<typename Func, typename Tuple, int CommandIdx>
-  Command<Func, Tuple, CommandIdx>& 
-  Command<Func, Tuple, CommandIdx>::operator() (unsigned aId,
-                                    const std::string& aFlags,
-                                    CommandArgType<Tuple>* aType,
-                                    const std::string& aDescription,
-                                    bool isRequired)
-  {
-    std::set<std::string> args;
-    args << aFlags;
-    for (std::set<std::string>::iterator i = args.begin(); i != args.end(); ++i) {
-      std::string toAdd = (i->size() == 1) ? "-" + *i : "--" + *i;
-      theArgs.insert(std::make_pair(toAdd,
-                                    new CommandArg<Tuple>(aId,
-                                                          aType,
-                                                          args,
-                                                          aDescription,
-                                                          isRequired)
-                                    )
-                     );
-    }
-    return *this;
-  }
-  
+    std::map<std::string, CommandArg<Tuple>*> theArgs;
+  };
+
+/*****************************************************************************/
+/*****************************************************************************/
+
+template<typename Func, typename Tuple, int CommandIdx>
+Command<Func, Tuple, CommandIdx>::~Command()
+{
+  typedef std::map<std::string, CommandArg<Tuple>*> ArgType;
+  for (typename ArgType::iterator i = theArgs.begin(); i != theArgs.end(); ++i) {
+    delete i->second;
+  }
+}
+
+template<typename Func, typename Tuple, int CommandIdx>
+void
+Command<Func, Tuple, CommandIdx>::printHelp() const
+{
+  std::cout << "Purpose: " << getDescription() << std::endl;
+
+  typename std::map<std::string, CommandArg<Tuple>*>::const_iterator lIter = theArgs.begin();
+  if (lIter == theArgs.end()) {
+    std::cout << "This command has no arguments." << std::endl;
+    std::cout << std::endl;
+    return;
+  }
+  
+  std::cout << "Arguments:" << std::endl << std::endl;
+  for (; lIter != theArgs.end(); ++lIter) {
+    std::cout << "  " << lIter->first << "\t" << lIter->second->getDescription() << std::endl;
+  }
+  std::cout << std::endl;
+}
+
+template<typename Func, typename Tuple, int CommandIdx>
+void
+Command<Func, Tuple, CommandIdx>::splitNames(const std::string& aNames, std::set<std::string>& aSet)
+{
+  std::string::size_type before = 0;
+  std::string::size_type pos = aNames.find(" ", 0);
+  while (pos != aNames.npos) {
+    std::string lName = aNames.substr(before, pos);
+    if (lName != "") {
+      aSet.insert(lName);
+    }
+    before = pos + 1;
+    pos = aNames.find(" ", before);
+  }
+  std::string lName = aNames.substr(before);
+  if (lName != "") {
+    aSet.insert(lName);
+  }
+}
+
+template<typename Func, typename Tuple, int CommandIdx>
+void
+Command<Func, Tuple, CommandIdx>::addArgument(
+  unsigned aId,
+  const std::string& aFlags,
+  CommandArgType<Tuple>* aType,
+  const std::string& aDescription,
+  bool isRequired)
+{
+  std::set<std::string> lNames;
+  splitNames(aFlags, lNames);
+
+  for (std::set<std::string>::iterator i = lNames.begin(); i != lNames.end(); ++i) {
+    std::string toAdd = (i->size() == 1) ? "-" + *i : "--" + *i;
+    CommandArg<Tuple>* lArg = new CommandArg<Tuple>(aId, aType, lNames, aDescription, isRequired);
+    theArgs.insert(std::make_pair(toAdd, lArg));
+  }
+}
+
+/*****************************************************************************/
+
   template<typename Tuple, typename T, int Idx>
   CommandArgType<Tuple>* createArgType(Tuple t)
   {
@@ -290,6 +226,16 @@
     return new Command<Func, Tuple, CommandIdx>(aName, aFunction, aDescription);
   }
   
+  template<int CommandIdx, typename Tuple, typename Func>
+  Command<Func, Tuple, CommandIdx>* createCommand(Tuple t,
+                                                  const std::string& aName,
+                                                  const std::set<std::string>& aAliases,
+                                                  Func& aFunction,
+                                                  const std::string& aDescription)
+  {
+    return new Command<Func, Tuple, CommandIdx>(aName, aAliases, aFunction, aDescription);
+  }
+  
   template<typename Func, typename Tuple, int CommandIdx>
   bool CommandInstance<Func, Tuple, CommandIdx>::
   parseArguments(const std::vector<std::string>& args,
@@ -301,29 +247,34 @@
     for (ArgType::size_type i = 1; i < size; ++i) {
       typename CArgType::const_iterator pos = aCommandArgs.find(args[i]);
       if (pos == aCommandArgs.end()) {
-        std::cerr << "Error: Unknown Argument " << args[i] << std::endl;
+        std::cerr << "Error: Unknown option " << args[i] << std::endl;
         parseError = true;
         return false;
       }
       const CommandArg<Tuple>& arg = *(pos->second);
-      if (!arg.isVoid() && args[++i][0] == '-') {
-        std::cerr << "Did not expect parameter for option " << args[i] << std::endl;
-        return false;
-      }
       std::auto_ptr<CommandArgInstance<Tuple> > instance;
       if (arg.isVoid()) {
         instance.reset(arg.parse("1"));
       } else {
+        ++i;
+        if (i >= size) {
+          std::cerr << "Error: Missing value for argument " << args[i - 1] << std::endl;
+          parseError = true;
+          allSet = false;
+          return false;
+        }
         instance.reset(arg.parse(args[i]));
       }
-      instance->insertValue(theTuple);
+      if (instance.get()) {
+        instance->insertValue(theTuple);
+      }
     }
     bool allSet = true;
     for (typename CArgType::const_iterator i = aCommandArgs.begin();
          i != aCommandArgs.end(); ++i)
     {
       if (i->second->isRequired() && !i->second->isSet(theTuple)) {
-        std::cerr << "Error: Argument " << i->second->get_name() << " not set" << std::endl;
+        std::cerr << "Error: Argument -" << i->second->getName() << " not set" << std::endl;
         allSet = false;
       }
     }
@@ -336,4 +287,7 @@
     theFunction.template handle<CommandIdx>(this->theTuple);
   }
 
-}} // end of namespace zorba::debugclient
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_H

=== added file 'bin/debugger/command_arg.h'
--- bin/debugger/command_arg.h	1970-01-01 00:00:00 +0000
+++ bin/debugger/command_arg.h	2012-08-19 03:54:29 +0000
@@ -0,0 +1,237 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_ARG_H
+#define ZORBA_DEBUGGER_COMMAND_ARG_H
+
+#include <string>
+#include <iostream>
+#include <set>
+#include <sstream>
+
+#include "tuple.h"
+
+
+namespace zorba { namespace debugger {
+
+template<typename Tuple>
+class CommandArg;
+
+template<typename Tuple>
+class CommandArgInstance {
+  public:
+    virtual int get_index() const = 0;
+    virtual const CommandArg<Tuple>* get_arg() const = 0;
+    virtual void insertValue(Tuple& t) = 0;
+    virtual bool isSet(Tuple& t) const = 0;
+};
+
+template<typename T, int Idx, typename Tuple>
+class TypedCommandArgInstance : public CommandArgInstance<Tuple>
+{
+  public:
+    TypedCommandArgInstance(T aValue, const CommandArg<Tuple>* aArg)
+      : theValue(aValue), theArg(aArg)
+    {
+    }
+
+    virtual int
+    get_index() const
+    {
+      return Idx;
+    }
+
+    virtual const CommandArg<Tuple>*
+    get_arg() const
+    {
+      return theArg;
+    }
+
+    virtual void
+    insertValue(Tuple& t)
+    {
+      ZORBA_TR1_NS::get<Idx>(t).first = true;
+      ZORBA_TR1_NS::get<Idx>(t).second = theValue;
+    }
+
+    virtual bool isSet(Tuple& t) const
+    {
+      return ZORBA_TR1_NS::get<Idx>(t).first;
+    }
+
+  private:
+
+    T theValue;
+    const CommandArg<Tuple>* theArg;
+};
+  
+template<typename Tuple>
+class CommandArgType
+{
+  public:
+    virtual CommandArgInstance<Tuple>*
+    parse(
+      const std::string& str,
+      const CommandArg<Tuple>* arg) = 0;
+
+    virtual bool
+    isVoid() const = 0;
+  
+    virtual bool
+    isSet(Tuple& t) const = 0;
+
+    virtual ~CommandArgType() {}
+};
+  
+  template<typename T, int Idx, typename Tuple>
+  class TypedCommandArgType : public CommandArgType<Tuple> {
+  public:
+    typedef T Type;
+  public: // implementation
+    TypedCommandArgType(bool aIsVoid) : theIsVoid(aIsVoid) {}
+    TypedCommandArgType(const T& aValue,
+                        bool aIsVoid)
+    : theDefault(aValue), theIsVoid(aIsVoid) {}
+    virtual CommandArgInstance<Tuple>* parse(const std::string& str,
+                                             const CommandArg<Tuple>* arg)
+    {
+      T aValue;
+
+      // special treatment for strings
+      // this is a double hack:
+      // - we check the type name if this starts with: class std::basic_string
+      // - we use void* in readEntireString to workaround the template type T
+      //   which would otherwise complain during compilation if types and
+      //   operators do not match
+      // TOSO: probably someone can find a more elegant solution
+      std::string lTypeName(typeid(T).name());
+      if (lTypeName.find("class std::basic_string") == 0) {
+        readEntireString(str, &aValue);
+      } else {
+        std::stringstream stream(str);
+        std::stringstream out;
+        stream >> aValue;
+        if (stream.fail()) {
+          std::cerr << "Error: Could not parse value \"" << str << "\" as type "
+            << typeid(T).name()
+            << std::endl;
+          return 0;
+        }
+      }
+
+      return new TypedCommandArgInstance<T, Idx, Tuple>(aValue, arg);
+    }
+    virtual bool isVoid() const { return theIsVoid; }
+    virtual bool isSet(Tuple& t) const
+    {
+      return ZORBA_TR1_NS::get<Idx>(t).first;
+    }
+  private:
+    void readEntireString(std::string aIn, void* aValue)
+    {
+      *((std::string*)aValue) = aIn;
+    }
+
+    TypedCommandArgType<T, Idx, Tuple>() {}
+    T theDefault;
+    bool theIsVoid;
+  };
+
+  template<typename Tuple>
+  class CommandArg {
+  public:
+    CommandArg(unsigned aId,
+               CommandArgType<Tuple>* aType,
+               const std::set<std::string>& aNames,
+               const std::string& aDescription,
+               bool aIsRequired)
+    : theId(aId),
+    theType(aType),
+    theNames(aNames),
+    theDescription(aDescription),
+    theIsRequired(aIsRequired)
+    {
+    }
+
+    ~CommandArg()
+    { 
+      delete theType;
+    }
+
+    unsigned
+    get_id() const
+    {
+      return theId;
+    }
+
+    bool
+    canHandle(const std::string& arg) const
+    {
+      if (theNames.find(arg) != theNames.end()) {
+        return true;
+      }
+      return false;
+    }
+
+    CommandArgInstance<Tuple>*
+    parse(const std::string& str) const
+    {
+      return theType->parse(str, this);
+    }
+
+    bool
+    isVoid() const
+    {
+      return theType->isVoid();
+    }
+    
+    bool
+    isRequired() const
+    {
+      return theIsRequired;
+    }
+
+    std::string
+    getName() const
+    {
+      return *(theNames.begin());
+    }
+
+    std::string
+    getDescription() const
+    {
+      return theDescription;
+    }
+
+    bool
+    isSet(Tuple& t) const
+    {
+      return theType->isSet(t);
+    }
+
+  private:
+
+    unsigned theId;
+    CommandArgType<Tuple>* theType;
+    std::set<std::string> theNames;
+    std::string theDescription;
+    bool theIsRequired;
+  };
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_ARG_H

=== modified file 'bin/debugger/command_line_handler.cpp'
--- bin/debug_client/command_line_handler.cpp	2011-07-01 01:53:24 +0000
+++ bin/debugger/command_line_handler.cpp	2012-08-19 03:54:29 +0000
@@ -1,4 +1,4 @@
-/*
+  /*
  * Copyright 2006-2008 The FLWOR Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,225 +23,385 @@
 # define msleep Sleep
 #endif
 
-namespace zorba { namespace debugclient {
+#include "command_prompt.h"
+
+
+namespace zorba { namespace debugger {
   
-  using namespace ::std;
   using namespace ::ZORBA_TR1_NS;
   
-  CommandLineHandler::CommandLineHandler(unsigned short port,
-                                         LockFreeConsumer<std::size_t>& aConsumer,
-                                         LockFreeConsumer<bool>& aContinueQueue,
-                                         EventHandler& aHandler,
-                                         CommandLine& aCommandLine)
+CommandLineHandler::CommandLineHandler(
+  unsigned short port,
+  LockFreeConsumer<std::size_t>& aConsumer,
+  LockFreeConsumer<bool>& aContinueQueue,
+  EventHandler* aHandler,
+  CommandPrompt* aCommandPrompt)
   : theConsumer(aConsumer),
     theContinueQueue(aContinueQueue),
-    theClient(DebuggerClient::createDebuggerClient(&aHandler, port, "localhost")),
-    theCommandLine(aCommandLine),
-    theQuit(false), theContinue(false), theWaitFor(0)
+    theClient(DebuggerClient::createDebuggerClient(aHandler, port, "localhost")),
+    theCommandLine(aCommandPrompt),
+    theQuit(false), theTerminated(true), theContinue(false), theWaitFor(0)
   {
     addCommands();
   }
   
-  CommandLineHandler::~CommandLineHandler()
-  {
-  }
+CommandLineHandler::~CommandLineHandler()
+{
+}
   
-  void CommandLineHandler::execute()
-  {
-    theClient->accept();
-    std::set<std::size_t> lIdList;
-    do {
+void
+CommandLineHandler::execute()
+{
+  theClient->accept();
+  std::set<std::size_t> lIdList;
+  do {
+    getNextId(lIdList);
+    while (lIdList.find(theWaitFor) == lIdList.end()) {
       getNextId(lIdList);
-      while (!theQuit && lIdList.find(theWaitFor) == lIdList.end()) {
-        getNextId(lIdList);
-        msleep(20);
-      }
-      while (!theContinueQueue.consume(theQuit)) {
-        msleep(20);
-      }
-      theQuit = !theQuit;
-      if (!theQuit) {
-        theCommandLine.execute();
-        while (theContinue) {
-          theContinue = false;
-          theCommandLine.execute();
-        }
-      }
-    } while (!theQuit);
-  }
-  
-  void CommandLineHandler::getNextId(std::set<std::size_t>& aIdList)
-  {
-    std::size_t result;
-    if (theConsumer.consume(result)) {
-      aIdList.insert(result);
-    }
-  }
-  
-  template<>
-  void CommandLineHandler::handle<Status>(ZORBA_TR1_NS::tuple<> &t)
-  {
-    theWaitFor = theClient->status();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<Quit>(ZORBA_TR1_NS::tuple<> &t)
-  {
+      msleep(20);
+    }
+    bool lCanQuit;
+    while (!theContinueQueue.consume(lCanQuit)) {
+      msleep(20);
+    }
+    if (lCanQuit) {
+      theTerminated = true;
+    }
+    theCommandLine->execute();
+    while (theContinue) {
+      theContinue = false;
+      theCommandLine->execute();
+    }
+  } while (!theQuit);
+}
+  
+void
+CommandLineHandler::getNextId(std::set<std::size_t>& aIdList)
+{
+  std::size_t result;
+  if (theConsumer.consume(result)) {
+    aIdList.insert(result);
+  }
+}
+
+template<>
+void
+CommandLineHandler::handle<Status>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theWaitFor = theClient->status();
+}
+
+template<>
+void
+CommandLineHandler::handle<Variables>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theWaitFor = theClient->variables();
+}
+
+template<>
+void
+CommandLineHandler::handle<Quit>(ZORBA_TR1_NS::tuple<> &t)
+{
+  if (!theTerminated) {
     bool answered = false;
     while (!answered) {
       std::cout << "Do you really want to stop debugging and exit? (y/n) ";
-      char answer;
-      std::cin >> answer;
-      std::cout << std::endl;
-      if (answer == 'y') {
+      std::string lAnswer;
+      std::getline(std::cin, lAnswer);
+      if (lAnswer == "y" || lAnswer == "yes") {
         answered = true;
-      } else if (answered == 'n') {
+      } else if (lAnswer == "n" || lAnswer == "no") {
         theContinue = true;
         return;
       }
     }
-    theWaitFor = theClient->stop();
-    theClient->quit();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<Run>(ZORBA_TR1_NS::tuple<> &t)
-  {
-    theWaitFor = theClient->run();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointSet>(std::tr1::tuple<bstring, bstring, bint> &t)
-  {
-    DebuggerClient::BreakpointType lType = DebuggerClient::Line;
-    bool lEnabled = true;
-    if (get<0>(t).first) {
-      if (get<0>(t).second == "disabled") {
-        lEnabled = false;
-      }
-    }
-    theWaitFor = theClient->breakpoint_set(lType,
-                                           lEnabled,
-                                           get<1>(t).second,
-                                           get<2>(t).second);
-  }
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointGet>(tuple<bint> &aTuple)
-  {
-    theWaitFor = theClient->breakpoint_get(get<0>(aTuple).second);
-  }
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointDel>(tuple<bint> &aTuple)
-  {
-    theWaitFor = theClient->breakpoint_remove(get<0>(aTuple).second);
-  }
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointList>(tuple<> &t)
-  {
-    theWaitFor = theClient->breakpoint_list();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<StackDepth>(tuple<> &t)
-  {
-    theWaitFor = theClient->stack_depth();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<StackGet>(tuple<bint> &aTuple)
-  {
-    if (get<0>(aTuple).first) {
-      theWaitFor = theClient->stack_get(get<0>(aTuple).second);
-    } else {
-      theWaitFor = theClient->stack_get();
-    }
-  }
-  
-  template<>
-  void CommandLineHandler::handle<ContextNames>(tuple<>& aTuple)
-  {
-    theWaitFor = theClient->context_names();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<ContextGet>(tuple<bint> &aTuple)
-  {
-    if (get<0>(aTuple).first)
-      theWaitFor = theClient->context_get(get<0>(aTuple).second);
-    else
-      theWaitFor = theClient->context_get();
-  }
-  
-  template<>
-  void CommandLineHandler::handle<Eval>(tuple<bstring>& aTuple)
-  {
-    theWaitFor = theClient->eval(get<0>(aTuple).second);
-  }
-  
-  void CommandLineHandler::addCommands()
-  {
-    theCommandLine << createCommand<Status>(tuple<>(), "status", *this,
-                                            "Gets the status of the server");
-    theCommandLine << createCommand<Quit>(tuple<>(), "quit", *this,
-                                          "Stops debugging and quits the client");
-    theCommandLine << createCommand<Run>(tuple<>(), "run", *this, "Run the Query");
-    {
-      Command<CommandLineHandler, tuple<bstring, bstring, bint>, BreakpointSet>* lCommand =
-      createCommand<BreakpointSet>(tuple<bstring, bstring, bint>(), "break", *this, "Set a breakpoint");
-      (*lCommand)(0, "s", createArgType<tuple<bstring, bstring, bint>, std::string, 0>(tuple<bstring, bstring, bint>()),
-                  "breakpoint state (enabled or disabled - default: enabled)", false);
-      (*lCommand)(1, "f", createArgType<tuple<bstring, bstring, bint>, std::string, 1>(tuple<bstring, bstring, bint>()),
-                  "The name of the file where to stop", true);
-      (*lCommand)(2, "l", createArgType<tuple<bstring, bstring, bint>, int, 2>(tuple<bstring, bstring, bint>()),
-                  "The line number", true);
-      
-      theCommandLine << lCommand;
-    }
-    {
-      Command<CommandLineHandler, tuple<bint>, BreakpointGet>* lCommand
-      = createCommand<BreakpointGet>(tuple<bint>(), "binfo", *this, 
-                                   "Get information about a given breakpoint");
-      (*lCommand)(0, "i", createArgType<tuple<bint>, int, 0>(tuple<bint>()),
-                  "The id of the breakpoint", true);
-      
-      theCommandLine << lCommand;
-    }
-    {
-      Command<CommandLineHandler, tuple<bint>, BreakpointDel>* lCommand
-      = createCommand<BreakpointDel>(tuple<bint>(), "bdel", *this, "Delete a breakpoint with a given id");
-      (*lCommand)(0, "i", createArgType<tuple<bint>, int, 0>(tuple<bint>()), "The id of the breakpoint", true);
-      
-      theCommandLine << lCommand;
-    }
-    theCommandLine << createCommand<BreakpointList>(tuple<>(), "blist", *this, "List all set breakpoints");
-    theCommandLine << createCommand<StackDepth>(tuple<>(), "sdepth", *this, "Get the depth of the stack");
-    {
-      Command<CommandLineHandler, tuple<bint>, StackGet>* lCommand
-      = createCommand<StackGet>(tuple<bint>(), "sget", *this, "Get information about one or all stack frames");
-      (*lCommand)(0, "d", createArgType<tuple<bint>, int, 0>(tuple<bint>()), "The stack entry two show (show all if not provided)", false);
-      theCommandLine << lCommand;
-    }
-    theCommandLine << createCommand<ContextNames>(tuple<>(), "cnames", *this, "Get the names of the avilable contexts");
-    {
-      Command<CommandLineHandler, tuple<bint>, ContextGet>* lCommand
-      = createCommand<ContextGet>(tuple<bint>(), "cget", *this, "Get a context");
-      
-      (*lCommand)(0, "c", createArgType<tuple<bint>, int, 0>(tuple<bint>()), "The id of the context", false);
-      
-      theCommandLine << lCommand;
-    }
-    {
-      Command<CommandLineHandler, tuple<bstring>, Eval>* lCommand
-      = createCommand<Eval>(tuple<bstring>(), "eval", *this, "Evaluate a function");
-      
-      (*lCommand)(0, "c", createArgType<tuple<bstring>, std::string, 0>(tuple<bstring>()), "The command to evaluate", true);
-      
-      theCommandLine << lCommand;
-    }
-  }
-  
-}} // namespace zorba::debugclient
-
+  }
+  theWaitFor = theClient->stop(true);
+  theClient->quit();
+  theQuit = true;
+}
+
+template<>
+void
+CommandLineHandler::handle<Run>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theTerminated = false;
+  theWaitFor = theClient->run();
+}
+
+template<>
+void
+CommandLineHandler::handle<Stop>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theWaitFor = theClient->stop(false);
+}
+
+template<>
+void
+CommandLineHandler::handle<BreakpointSet>(std::tr1::tuple<bstring, bstring, bint> &aTuple)
+{
+  DebuggerClient::BreakpointType lType = DebuggerClient::Line;
+  bool lEnabled = true;
+  if (get<0>(aTuple).first) {
+    if (get<0>(aTuple).second == "disabled") {
+      lEnabled = false;
+    }
+  }
+  theWaitFor = theClient->breakpoint_set(lType,
+                                          lEnabled,
+                                          get<1>(aTuple).second,
+                                          get<2>(aTuple).second);
+}
+  
+template<>
+void
+CommandLineHandler::handle<BreakpointGet>(tuple<bint> &aTuple)
+{
+  theWaitFor = theClient->breakpoint_get(get<0>(aTuple).second);
+}
+  
+template<>
+void
+CommandLineHandler::handle<BreakpointRemove>(tuple<bint> &aTuple)
+{
+  theWaitFor = theClient->breakpoint_remove(get<0>(aTuple).second);
+}
+  
+template<>
+void
+CommandLineHandler::handle<BreakpointList>(tuple<> &aTuple)
+{
+  theWaitFor = theClient->breakpoint_list();
+}
+  
+template<>
+void
+CommandLineHandler::handle<StackDepth>(tuple<> &aTuple)
+{
+  theWaitFor = theClient->stack_depth();
+}
+  
+template<>
+void
+CommandLineHandler::handle<StackGet>(tuple<bint> &aTuple)
+{
+  if (get<0>(aTuple).first) {
+    theWaitFor = theClient->stack_get(get<0>(aTuple).second);
+  } else {
+    theWaitFor = theClient->stack_get();
+  }
+}
+  
+template<>
+void
+CommandLineHandler::handle<ContextNames>(tuple<>& aTuple)
+{
+  theWaitFor = theClient->context_names();
+}
+  
+template<>
+void CommandLineHandler::handle<ContextGet>(tuple<bint, bint> &aTuple)
+{
+  int lDepth = -1;
+  int lContext = -1;
+
+  if (get<0>(aTuple).first) {
+    lDepth = get<0>(aTuple).second;
+  }
+  if (get<1>(aTuple).first) {
+    lContext  = get<1>(aTuple).second;
+  }
+  theWaitFor = theClient->context_get(lDepth, lContext);
+}
+
+template<>
+void CommandLineHandler::handle<Source>(tuple<bint, bint, bstring> &aTuple)
+{
+  theWaitFor = theClient->source(
+    get<2>(aTuple).second,
+    get<0>(aTuple).second,
+    get<1>(aTuple).second);
+}
+  
+template<>
+void CommandLineHandler::handle<Eval>(tuple<bstring>& aTuple)
+{
+  theWaitFor = theClient->eval(get<0>(aTuple).second);
+}
+
+template<>
+void
+CommandLineHandler::handle<StepIn>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theTerminated = false;
+  theWaitFor = theClient->step_into();
+}
+
+template<>
+void
+CommandLineHandler::handle<StepOut>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theWaitFor = theClient->step_out();
+}
+
+template<>
+void
+CommandLineHandler::handle<StepOver>(ZORBA_TR1_NS::tuple<> &t)
+{
+  theTerminated = false;
+  theWaitFor = theClient->step_over();
+}
+
+void
+CommandLineHandler::addCommands()
+{
+  typedef tuple<> TUPLE;
+  typedef tuple<bint> TUPLE_INT;
+  typedef tuple<bstring> TUPLE_STR;
+  typedef tuple<bint, bint> TUPLE_INT_INT;
+  typedef tuple<bstring, bstring, bint> TUPLE_STR_STR_INT;
+  typedef tuple<bint, bint, bstring> TUPLE_INT_INT_STR;
+
+  // DBGP: status
+  *theCommandLine << createCommand<Status>(TUPLE(), "status", *this, "Gets the status of the server");
+
+  // ALIAS: variables (context_get -c -1)
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("vars");
+    *theCommandLine << createCommand<Variables>(TUPLE(), "variables", lAliases, *this, "Gets the variables visible in the current scope");
+  }
+
+  // META: quit
+  *theCommandLine << createCommand<Quit>(TUPLE(), "quit", *this, "Stops debugging and quits the client");
+
+  // DBGP: run
+  *theCommandLine << createCommand<Run>(TUPLE(), "run", *this, "Run the query");
+
+  // DBGP: stop
+  *theCommandLine << createCommand<Stop>(TUPLE(), "stop", *this, "Stop the query");
+
+  // DBGP: breakpoint_set
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("break");
+    Command<CommandLineHandler, TUPLE_STR_STR_INT, BreakpointSet>* lCommand =
+      createCommand<BreakpointSet>(TUPLE_STR_STR_INT(), "bset", lAliases, *this, "Set a breakpoint");
+
+    lCommand->addArgument(0, "s", createArgType<TUPLE_STR_STR_INT, std::string, 0>(TUPLE_STR_STR_INT()), "breakpoint state (optional, 'enabled' or 'disabled', default: enabled)", false);
+    lCommand->addArgument(1, "f", createArgType<TUPLE_STR_STR_INT, std::string, 1>(TUPLE_STR_STR_INT()), "name of the file where to stop", true);
+    lCommand->addArgument(2, "l", createArgType<TUPLE_STR_STR_INT, int, 2>(TUPLE_STR_STR_INT()), "line number", true);
+      
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: breakpoint_get
+  {
+    Command<CommandLineHandler, TUPLE_INT, BreakpointGet>* lCommand =
+      createCommand<BreakpointGet>(TUPLE_INT(), "bget", *this, "Get information about a given breakpoint");
+
+    lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "breakpoint ID", true);
+      
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: breakpoint_remove
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("clear");
+    lAliases.insert("delete");
+    Command<CommandLineHandler, TUPLE_INT, BreakpointRemove>* lCommand = 
+      createCommand<BreakpointRemove>(TUPLE_INT(), "bremove", lAliases, *this, "Delete a breakpoint");
+
+    lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "breakpoint ID", true);
+      
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: breakpoint_list
+  *theCommandLine << createCommand<BreakpointList>(TUPLE(), "blist", *this, "List all set breakpoints");
+
+  // DBGP: stack_depth
+  *theCommandLine << createCommand<StackDepth>(TUPLE(), "sdepth", *this, "Get the depth of the stack");
+
+  // DBGP: stack_get
+  {
+    Command<CommandLineHandler, TUPLE_INT, StackGet>* lCommand =
+      createCommand<StackGet>(TUPLE_INT(), "sget", *this, "Get information about one or all stack frames");
+
+    lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "stack frame to show: 0 for current stack frame, N for the main module (optional, all frames are shown if not provided)", false);
+
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: context_names
+  *theCommandLine << createCommand<ContextNames>(tuple<>(), "cnames", *this, "Get the names of the avilable contexts");
+  // the DBGP -d arguments for this command is omitted since we always have/return: 0 - Local, 1 - Global
+
+  // DBGP: context_get
+  {
+    Command<CommandLineHandler, TUPLE_INT_INT, ContextGet>* lCommand =
+      createCommand<ContextGet>(TUPLE_INT_INT(), "cget", *this, "Get a context (list variables in this context)");
+
+    lCommand->addArgument(0, "d", createArgType<TUPLE_INT_INT, int, 0>(TUPLE_INT_INT()), "stack depth (optional, default: 0)", false);
+    lCommand->addArgument(0, "c", createArgType<TUPLE_INT_INT, int, 1>(TUPLE_INT_INT()), "context ID: 0 for Local, 1 for Global (optional, default: 0)", false);
+
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: source
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("list");
+    Command<CommandLineHandler, TUPLE_INT_INT_STR, Source>* lCommand =
+      createCommand<Source>(TUPLE_INT_INT_STR(), "source", lAliases, *this, "List source code");
+
+    lCommand->addArgument(0, "b", createArgType<TUPLE_INT_INT_STR, int, 0>(TUPLE_INT_INT_STR()), "begin line (optional, default: first line)", false);
+    lCommand->addArgument(1, "e", createArgType<TUPLE_INT_INT_STR, int, 1>(TUPLE_INT_INT_STR()), "end line (optional, default: last line)", false);
+    lCommand->addArgument(2, "f", createArgType<TUPLE_INT_INT_STR, std::string, 2>(TUPLE_INT_INT_STR()), "file URI (optional, default: the file in the top-most stack frame during execution, main module otherwise)", false);
+
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: eval
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("print");
+    Command<CommandLineHandler, TUPLE_STR, Eval>* lCommand =
+      createCommand<Eval>(TUPLE_STR(), "eval", lAliases, *this, "Evaluate an expression");
+
+    // TODO: this argument should not be here at all. Eval has the form: eval -i transaction_id -- {DATA}
+    // Eval should be called with a command like: eval 1 + 3
+    // - no need for an argument name
+    // - everything following the fist contiguous set of whitespaces are sent as string
+    lCommand->addArgument(0, "c", createArgType<TUPLE_STR, std::string, 0>(TUPLE_STR()), "expression to evaluate", true);
+      
+    *theCommandLine << lCommand;
+  }
+
+  // DBGP: step_in
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("step");
+    lAliases.insert("s");
+    *theCommandLine << createCommand<StepIn>(TUPLE(), "in", lAliases, *this, "Step in");
+  }
+
+  // DBGP: step_out
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("finish");
+    *theCommandLine << createCommand<StepOut>(TUPLE(), "out", lAliases, *this, "Step out");
+  }
+
+  // DBGP: step_over
+  {
+    std::set<std::string> lAliases;
+    lAliases.insert("next");
+    lAliases.insert("n");
+    *theCommandLine << createCommand<StepOver>(TUPLE(), "over", lAliases, *this, "Step over");
+  }
+}
+  
+} // namespace zorba
+} // namespace debugger

=== modified file 'bin/debugger/command_line_handler.h'
--- bin/debug_client/command_line_handler.h	2011-07-01 01:53:24 +0000
+++ bin/debugger/command_line_handler.h	2012-08-19 03:54:29 +0000
@@ -14,46 +14,71 @@
  * limitations under the License.
  */
 #pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
+#define ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
 
 #include <set>
 #include <cassert>
+
 #include <zorba/debugger_client.h>
-#include "debug_command.h"
+
+#include "command.h"
 #include "event_handler.h"
 
-namespace zorba { namespace debugclient {
-  
+
+namespace zorba { namespace debugger {
+
+  class CommandPrompt;
+
   enum Commands {
     Status,
+    Variables,
+    Quit,
     Run,
+    Stop,
     BreakpointSet,
     BreakpointGet,
-    BreakpointDel,
+    BreakpointRemove,
     BreakpointList,
     StackDepth,
     StackGet,
     ContextNames,
     ContextGet,
+    Source,
     Eval,
-    Quit
+    StepIn,
+    StepOut,
+    StepOver
   };
   
-  class CommandLineHandler {
+class CommandLineHandler
+{
   private:
+
     typedef std::pair<bool, std::string> bstring;
     typedef std::pair<bool, int> bint;
+
   public:
-    CommandLineHandler(unsigned short port,
-                       LockFreeConsumer<std::size_t>& aConsumer,
-                       LockFreeConsumer<bool>& aContinueQueue,
-                       EventHandler& aHandler,
-                       CommandLine& aCommandLine);
+
+    CommandLineHandler(
+      unsigned short port,
+      LockFreeConsumer<std::size_t>& aConsumer,
+      LockFreeConsumer<bool>& aContinueQueue,
+      EventHandler* aHandler,
+      CommandPrompt* aCommandPrompt);
+
     ~CommandLineHandler();
+
   public:
     void execute();
+  
   public: // Handlers
+
     template<int>
-    void handle(ZORBA_TR1_NS::tuple<>& aTuple) { assert(false); }
+    void handle(ZORBA_TR1_NS::tuple<>& aTuple)
+    {
+      assert(false);
+    }
     
     template<int>
     void handle(ZORBA_TR1_NS::tuple<bstring, bstring, bint>& t)
@@ -62,63 +87,96 @@
     }
     
     template<int>
+    void handle(ZORBA_TR1_NS::tuple<bint, bint, bstring>& t)
+    {
+      assert(false);
+    }
+    
+    template<int>
     void handle(ZORBA_TR1_NS::tuple<bint>& aTuple)
     {
       assert(false);
     }
     
     template<int>
+    void handle(ZORBA_TR1_NS::tuple<bint, bint>& aTuple)
+    {
+      assert(false);
+    }
+    
+    template<int>
     void handle(ZORBA_TR1_NS::tuple<bstring>& aTuple)
     {
       assert(false);
     }
+
   private:
-    LockFreeConsumer<std::size_t>& theConsumer;
-    LockFreeConsumer<bool>& theContinueQueue;
-    DebuggerClient* theClient;
-    CommandLine& theCommandLine;
-    bool theQuit;
-    bool theContinue;
-    std::size_t theWaitFor;
+    LockFreeConsumer<std::size_t>&  theConsumer;
+    LockFreeConsumer<bool>&         theContinueQueue;
+    DebuggerClient*                 theClient;
+    CommandPrompt*                  theCommandLine;
+    bool                            theQuit;
+    bool                            theTerminated;
+    bool                            theContinue;
+    std::size_t                     theWaitFor;
+
   private:
     void getNextId(std::set<std::size_t>& aIdList);
     void addCommands();
-  };
-  
-  template<>
-  void CommandLineHandler::handle<Status> (ZORBA_TR1_NS::tuple<>& t);
-  
-  template<>
-  void CommandLineHandler::handle<Quit> (ZORBA_TR1_NS::tuple<>& t);
-  
-  template<>
-  void CommandLineHandler::handle<Run> (ZORBA_TR1_NS::tuple<> &t);
-  
-  template<>
-  void CommandLineHandler::handle<StackDepth> (ZORBA_TR1_NS::tuple<>& t);
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointList> (ZORBA_TR1_NS::tuple<>& aTuple);
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointSet> (ZORBA_TR1_NS::tuple<bstring, bstring, bint> &t);
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
-  
-  template<>
-  void CommandLineHandler::handle<BreakpointDel>(ZORBA_TR1_NS::tuple<bint> &aTuple);
-  
-  template<>
-  void CommandLineHandler::handle<StackGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
-  
-  template<>
-  void CommandLineHandler::handle<ContextNames>(ZORBA_TR1_NS::tuple<> &aTuple);
-  
-  template<>
-  void CommandLineHandler::handle<ContextGet>(ZORBA_TR1_NS::tuple<bint> &aTuple);
-  
-  template<>
-  void CommandLineHandler::handle<Eval>(ZORBA_TR1_NS::tuple<bstring>& aTuple);
-  
-}} // close namespaces zorba::debugclient
+};
+
+template<>
+void CommandLineHandler::handle<Status> (ZORBA_TR1_NS::tuple<>& t);
+
+template<>
+void CommandLineHandler::handle<Quit> (ZORBA_TR1_NS::tuple<>& t);
+
+template<>
+void CommandLineHandler::handle<Run> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<Stop> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<StackDepth> (ZORBA_TR1_NS::tuple<>& t);
+
+template<>
+void CommandLineHandler::handle<BreakpointList> (ZORBA_TR1_NS::tuple<>& aTuple);
+  
+template<>
+void CommandLineHandler::handle<BreakpointSet> (ZORBA_TR1_NS::tuple<bstring, bstring, bint> &t);
+  
+template<>
+void CommandLineHandler::handle<BreakpointGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
+  
+template<>
+void CommandLineHandler::handle<BreakpointRemove>(ZORBA_TR1_NS::tuple<bint> &aTuple);
+  
+template<>
+void CommandLineHandler::handle<StackGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
+  
+template<>
+void CommandLineHandler::handle<ContextNames>(ZORBA_TR1_NS::tuple<> &aTuple);
+  
+template<>
+void CommandLineHandler::handle<ContextGet>(ZORBA_TR1_NS::tuple<bint, bint> &aTuple);
+  
+template<>
+void CommandLineHandler::handle<Source>(ZORBA_TR1_NS::tuple<bint, bint, bstring> &aTuple);
+  
+template<>
+void CommandLineHandler::handle<Eval>(ZORBA_TR1_NS::tuple<bstring>& aTuple);
+
+template<>
+void CommandLineHandler::handle<StepIn> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<StepOut> (ZORBA_TR1_NS::tuple<> &t);
+
+template<>
+void CommandLineHandler::handle<StepOver> (ZORBA_TR1_NS::tuple<> &t);
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H

=== added file 'bin/debugger/command_prompt.cpp'
--- bin/debugger/command_prompt.cpp	1970-01-01 00:00:00 +0000
+++ bin/debugger/command_prompt.cpp	2012-08-19 03:54:29 +0000
@@ -0,0 +1,286 @@
+/*
+ * 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.
+ */
+#include "command_prompt.h"
+
+#include <string>
+#include <vector>
+#include <map>
+#include <iostream>
+
+#include "command.h"
+
+
+namespace zorba { namespace debugger {
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+const char*
+prompt(EditLine* aEl) {
+  return "(xqdb) ";
+}
+#endif
+
+CommandPrompt::CommandPrompt()
+{
+#ifdef ZORBA_HAVE_LIBEDIT_H
+  theEditLine = el_init("xqdb", stdin, stdout, stderr);
+  theHistory = history_init();
+  HistEvent lHistoryEvent;
+  history(theHistory, &lHistoryEvent, H_SETSIZE, 100);
+
+  el_set(theEditLine, EL_PROMPT, prompt);
+
+  el_set(theEditLine, EL_HIST, history, theHistory);
+  el_set(theEditLine, EL_EDITOR, "emacs");
+#endif
+}
+
+CommandPrompt::~CommandPrompt()
+{
+#ifdef ZORBA_HAVE_LIBEDIT_H
+  history_end(theHistory);
+  el_end(theEditLine);
+#endif
+
+  std::map<std::string, UntypedCommand*>::iterator lIter;
+  for (lIter = theCommands.begin(); lIter != theCommands.end(); ++lIter) {
+    delete lIter->second;
+  }
+}
+
+void
+CommandPrompt::printHelp(UntypedCommand* aCommand)
+{
+  // if no command is provided, print all the available commands
+  if (!aCommand) {
+    std::cout << "Available commands:" << std::endl;
+
+    // print the names of all commands
+    std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.begin();
+    while (lIter != theCommands.end()) {
+      std::cout << "  " << (*lIter).first;
+      std::set<std::string> lAliases = (*lIter).second->getAliases();
+      std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
+      while (lAliasIter != lAliases.end()) {
+        std::cout << ", " << *lAliasIter;
+        lAliasIter++;
+      }
+      std::cout << std::endl;
+      lIter++;
+    }
+
+    // some hints for detailed help
+    std::cout << std::endl;
+    std::cout << "Type help <command> to get more information about one command." << std::endl;
+    std::cout << std::endl;
+  } else {
+    // ok, so we have a command; then print the help
+    aCommand->printHelp();
+  }
+}
+
+void
+CommandPrompt::execute()
+{
+  for (;;) {
+#ifdef ZORBA_HAVE_LIBEDIT_H
+    const char* lBuf;
+    int lCharsRead = -1;
+    lBuf = el_gets(theEditLine, &lCharsRead);
+    std::string lCommandLine(lBuf, lCharsRead - 1);
+#else
+    bool lWithOutput = true;
+    if (lWithOutput) {
+      std::cout << "(xqdb) ";
+    }
+    lWithOutput = true;
+    std::string lCommandLine;
+    std::getline(std::cin, lCommandLine);
+    if (std::cin.fail()) {
+      lWithOutput = false;
+      std::cin.clear();
+      continue;
+    }
+#endif
+    
+    std::vector<std::string> lArgs;
+
+    // split the command into arguments
+    parseLine(lCommandLine, lArgs);
+    std::string::size_type lSize = lArgs.size();
+
+    // empty command? do nothing!
+    if (lSize == 0) {
+      lArgs = theLastArgs;
+      if (lArgs.size() == 0) {
+        continue;
+      }
+    }
+#ifdef ZORBA_HAVE_LIBEDIT_H
+    else {
+      HistEvent lHistoryEvent;
+      history(theHistory, &lHistoryEvent, H_ENTER, lCommandLine.c_str());
+    }
+#endif
+    theLastArgs = lArgs;
+
+    UntypedCommand* lCommand = NULL;
+
+    // help is not a command but a hook here
+    if (lArgs.at(0) == "h" || lArgs.at(0) == "help") {
+      std::string lCmd = "";
+
+      // if the user needs the help for a specific command
+      if (lSize > 1) {
+        // do nothing if we don't have a command starting with this prefix?
+        // findCommand will print the appropriate errors
+        if (!findCommand(lArgs[1], lCommand)) {
+          continue;
+        }
+      }
+      printHelp(lCommand);
+      continue;
+    }
+    if (findCommand(lArgs[0], lCommand) && lCommand->execute(lArgs)) {
+      return;
+    }
+    continue;
+  }
+}
+  
+CommandPrompt&
+CommandPrompt::operator<<(UntypedCommand *aCommand)
+{
+  theCommands.insert(std::make_pair(aCommand->getName(), aCommand));
+  return *this;
+}
+
+bool
+CommandPrompt::findCommand(const std::string& aPrefix, UntypedCommand*& aCommand)
+{
+  std::vector<UntypedCommand*> lFoundCommands;
+
+  std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.begin();
+  while (lIter != theCommands.end()) {
+    // if a command name is equal with the prefix, this is the command we want
+    if ((*lIter).first == aPrefix) {
+      aCommand = (*lIter).second;
+      return true;
+    }
+
+    bool lIsCandidate = false;
+
+    // add this command to candidate commands if the prefix matches
+    if ((*lIter).first.find(aPrefix) == 0) {
+      lFoundCommands.push_back((*lIter).second);
+      lIsCandidate = true;
+    }
+
+    // now process the aliases
+    std::set<std::string> lAliases = (*lIter).second->getAliases();
+    std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
+    while (lAliasIter != lAliases.end()) {
+      // if a command alias is equal with the prefix, this is the command we want
+      if (*lAliasIter == aPrefix) {
+        aCommand = (*lIter).second;
+        return true;
+      }
+
+      // add this command to candidate commands if the prefix matches one alias
+      // and if the command is not already added 
+      if (!lIsCandidate && (*lAliasIter).find(aPrefix) == 0) {
+        lFoundCommands.push_back((*lIter).second);
+        break;
+      }
+      lAliasIter++;
+    }
+
+    lIter++;
+  }
+
+  if (lFoundCommands.empty()) {
+    std::cout << "Command not found: " << aPrefix << std::endl;
+    return false;
+  }
+
+  if (lFoundCommands.size() > 1) {
+    std::cout << "Ambigous command: " << aPrefix << std::endl;
+    // show all possible commands that start with this prefix
+    for (std::string::size_type i = 0; i < lFoundCommands.size(); i++) {
+      UntypedCommand* lCommand = lFoundCommands.at(i);
+
+      // commands
+      if (lCommand->getName().find(aPrefix) == 0) {
+        std::cout << "  " << lCommand->getName() << std::endl;
+      }
+
+      // and aliases
+      std::set<std::string> lAliases = lCommand->getAliases();
+      std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
+      while (lAliasIter != lAliases.end()) {
+        if ((*lAliasIter).find(aPrefix) == 0) {
+          std::cout << "  " << *lAliasIter << std::endl;
+        }
+        lAliasIter++;
+      }
+    }
+    return false;
+  }
+
+  aCommand = lFoundCommands[0];
+  return true;
+}
+
+void
+CommandPrompt::parseLine(const std::string& aLine, std::vector<std::string>& aVector)
+{
+  std::string::size_type lBefore = 0;
+  std::string::size_type lPos = aLine.find_first_of(" \t", 0);
+
+  while (lPos != aLine.npos) {
+    std::string lSub = aLine.substr(lBefore, lPos - lBefore);
+
+    // if two consecutive spaces, you get an empty string here
+    if (lSub != "") {
+      if (lSub[0] == '"') {
+        std::string::size_type lBeforeCopy = lBefore;
+        do {
+          lBeforeCopy = aLine.find("\"", lBeforeCopy + 1);
+        } while (lPos != aLine.npos && aLine.size() > lPos + 1 && aLine[lPos + 1] == '\\');
+        lPos = lBeforeCopy;
+        lSub = aLine.substr(lBefore + 1, lPos - lBefore - 1);
+      }
+      aVector.push_back(lSub);
+    }
+
+    lBefore = lPos + 1;
+    lPos = aLine.find_first_of(" \t", lBefore);
+  }
+  std::string lSub = aLine.substr(lBefore);
+
+  // catching the case when the command ends with a space
+  if (lSub == "") {
+    return;
+  }
+
+  if (lSub[0] == '"') {
+    lPos = aLine.find("\"", lBefore + 1);
+    lSub = aLine.substr(lBefore + 1, lPos - lBefore - 1);
+  }
+  aVector.push_back(lSub);
+}
+  
+} // namespace zorba
+} // namespace debugger

=== added file 'bin/debugger/command_prompt.h'
--- bin/debugger/command_prompt.h	1970-01-01 00:00:00 +0000
+++ bin/debugger/command_prompt.h	2012-08-19 03:54:29 +0000
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_COMMAND_PROMPT_H
+#define ZORBA_DEBUGGER_COMMAND_PROMPT_H
+
+#include <string>
+#include <map>
+#include <vector>
+
+#include "config.h"
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+# include <histedit.h>
+#endif
+
+
+namespace zorba { namespace debugger {
+
+class UntypedCommand;
+
+class CommandPrompt
+{
+  public:
+    CommandPrompt();
+    ~CommandPrompt();
+
+  public:
+
+    void execute();
+
+    CommandPrompt& operator<< (UntypedCommand* command);
+
+  private:
+
+    void
+    printHelp(UntypedCommand* command);
+
+    bool
+    findCommand(const std::string& prefix, UntypedCommand*& command);
+
+    void
+    parseLine(const std::string& line, std::vector<std::string>& vector);
+
+  private:
+    std::map<std::string, UntypedCommand*>  theCommands;
+    std::vector<std::string>                theLastArgs;
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+    EditLine*                               theEditLine;
+    History*                                theHistory;
+#endif
+};  
+
+  
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_COMMAND_PROMPT_H

=== added file 'bin/debugger/config.h.cmake'
--- bin/debugger/config.h.cmake	1970-01-01 00:00:00 +0000
+++ bin/debugger/config.h.cmake	2012-08-19 03:54:29 +0000
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+// This header is configured by Zorba's build process -- DO NOT EDIT!
+
+#ifndef ZORBA_DEBUGGER_CONFIG_H
+#define ZORBA_DEBUGGER_CONFIG_H
+
+#cmakedefine ZORBA_HAVE_LIBEDIT_H
+
+#endif /* ZORBA_DEBUGGER_CONFIG_H */

=== modified file 'bin/debugger/event_handler.cpp'
--- bin/debug_client/event_handler.cpp	2011-07-01 01:53:24 +0000
+++ bin/debugger/event_handler.cpp	2012-08-19 03:54:29 +0000
@@ -13,88 +13,93 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+#include "event_handler.h"
+
+#include <sstream>
+
 #include <zorba/zorba.h>
 #include <zorba/store_manager.h>
 #include <zorba/iterator.h>
-#include <sstream>
-#include "debug_client/event_handler.h"
 
-namespace zorba { namespace debugclient {
+namespace zorba { namespace debugger {
   
-  EventHandler::EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContProducer)
+EventHandler::EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContProducer)
   : theIdQueue(aQueue), theContinueProducer(aContProducer),
     theStore(StoreManager::getStore()),
     theZorbaInstance(Zorba::getInstance(theStore)),
     theStaticContext(theZorbaInstance->createStaticContext())
-    
-  {
-    try {
-      Zorba_CompilerHints_t lHints;
-      lHints.opt_level = ZORBA_OPT_LEVEL_O1;
-      std::auto_ptr<std::istream> stream(getCurrentDirectory());
-      zorba::String query;
-      char buffer[1024];
-      std::string::size_type s;
-      while ((s = stream->readsome(buffer, 1024))) {
-        query.append(std::string(buffer, s));
-      }
-      theStaticContext->loadProlog(query, lHints);
-    } catch (zorba::ZorbaException& e) {
-      std::cerr << "Exception: I was not able to load the query file:" << std::endl;
-      std::cerr << e.what() << std::endl;
-      throw;
-    }
-  }
-  
-  EventHandler::~EventHandler()
-  {
-    theStaticContext = 0;
-    theZorbaInstance->shutdown();
-    StoreManager::shutdownStore(theStore);
-  }
-  
-  void EventHandler::parseMessage(const std::string &aMessage)
-  {
-    try {
-      zorba::String queryString = "local:main(";
-      queryString += aMessage + ")";
-      XQuery_t query = theZorbaInstance->compileQuery(queryString, theStaticContext);
-      Iterator_t lIter = query->iterator();
-      Item item;
-      lIter->open();
-      bool doContinue = false;
-      lIter->next(item);
-      {
-        const std::string& continueString = item.getStringValue().str();
-        if (continueString == "true") {
-          doContinue = true;
-        } else if (continueString == "false") {
-          doContinue = false;
-        } else {
-          std::stringstream stream(continueString);
-          stream >> doContinue;
-        }
-      }
-      lIter->next(item);
-      std::size_t lId;
-      {
-        std::stringstream stream(item.getStringValue().c_str());
-        stream >> lId;
-      }
-      lIter->next(item);
-      std::cout << item.getStringValue() << std::endl;
-      theContinueProducer.produce(doContinue);
-      theIdQueue.produce(lId);
-    } catch (ZorbaException& e) {
-      std::cerr << "FATAL: could not execute query: " << std::endl;
-      std::cerr << e << std::endl;
-      std::cerr << "This is a bug, please report to zorba-users@xxxxxxxxxxxxxxxxxxxxx" << std::endl;
-      theContinueProducer.produce(false);
-    }
-  }
-  
-  void EventHandler::error(unsigned int errcode, const std::string &msg)
-  {
-    std::cerr << "Error " << errcode << ": " << msg << std::endl;
-  }
-}}
+{
+}
+
+EventHandler::~EventHandler()
+{
+  theStaticContext = 0;
+  theZorbaInstance->shutdown();
+  StoreManager::shutdownStore(theStore);
+}
+
+void
+EventHandler::init()
+{
+  try {
+    Zorba_CompilerHints_t lHints;
+    lHints.opt_level = ZORBA_OPT_LEVEL_O1;
+    zorba::String lProlog("import module namespace dmh = 'http://www.zorba-xquery.com/modules/debugger/dbgp-message-handler';");
+    theStaticContext->loadProlog(lProlog, lHints);
+  } catch (zorba::ZorbaException& e) {
+    std::cerr << "Exception: I was not able to load the query file:" << std::endl;
+    std::cerr << e.what() << std::endl;
+    throw;
+  }
+}
+
+void
+EventHandler::parseMessage(const std::string &aMessage)
+{
+  try {
+#ifndef NDEBUG
+    // uncomment this to see the raw messages received by the event handler
+    //std::cout << "Processing response: " << aMessage << std::endl;
+#endif
+    // the query to process the response
+    std::stringstream lQueryStream;
+    lQueryStream << "dmh:process(" << aMessage << ")";
+    XQuery_t lQuery = theZorbaInstance->compileQuery(lQueryStream.str(), theStaticContext);
+
+    // get the query result sequrence:
+    //   1. a message
+    Iterator_t lIter = lQuery->iterator();
+    Item lItem;
+    lIter->open();
+    lIter->next(lItem);
+    std::size_t lId;
+    std::stringstream lStream(lItem.getStringValue().c_str());
+    lStream >> lId;
+
+    //   2. an "idle" flag (to disable quit confirmation)
+    bool lCanQuit = false;
+    if (lIter->next(lItem)) {
+      String lMessage = lItem.getStringValue();
+      lCanQuit = lMessage == "idle";
+      std::cout << std::endl << lItem.getStringValue() << std::endl;
+    }
+    theContinueProducer.produce(lCanQuit);
+
+    // go and solve the event with this id
+    theIdQueue.produce(lId);
+  } catch (ZorbaException& e) {
+    std::cerr << "FATAL: could not execute query: " << std::endl;
+    std::cerr << e << std::endl;
+    std::cerr << "This is a bug, please report it at http://bugs.launchpad.net/zorba"; << std::endl;
+  }
+}
+  
+void
+EventHandler::error(unsigned int errcode, const std::string &msg)
+{
+  std::cerr << "Error " << errcode << ": " << msg << std::endl;
+}
+
+} // namespace zorba
+} // namespace debugger

=== modified file 'bin/debugger/event_handler.h'
--- bin/debug_client/event_handler.h	2011-07-01 01:53:24 +0000
+++ bin/debugger/event_handler.h	2012-08-19 03:54:29 +0000
@@ -14,33 +14,46 @@
  * limitations under the License.
  */
 #pragma once
+#ifndef ZORBA_DEBUGGER_EVENT_HANDLER_H
+#define ZORBA_DEBUGGER_EVENT_HANDLER_H
+
 #include <string>
 #include <iostream>
+
 #include <zorba/debugger_event_handler.h>
 #include <zorba/static_context.h>
+
 #include "lock_free_queue.h"
 
-namespace zorba {
-  class Zorba;
-}
-
-namespace zorba { namespace debugclient {
-  
-  class EventHandler : public zorba::DebuggerEventHandler
-  {
+
+namespace zorba { namespace debugger {
+
+class EventHandler : public zorba::DebuggerEventHandler
+{
   public:
-    EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContQueue);
+    EventHandler(
+      LockFreeProducer<std::size_t>& aQueue,
+      LockFreeProducer<bool>& aContQueue);
+
     ~EventHandler();
+
   public:
     virtual void parseMessage(const std::string& aMessage);
+
     virtual void error(unsigned int errcode, const std::string& msg);
+
+    virtual void init();
+
   private:
-    static std::istream* getCurrentDirectory();
     LockFreeProducer<std::size_t>& theIdQueue;
     LockFreeProducer<bool>& theContinueProducer;
     void* theStore;
     Zorba* theZorbaInstance;
     StaticContext_t theStaticContext;
-  };
+
+};
   
-}} // end of namespace zorba::debugclient
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_EVENT_HANDLER_H

=== modified file 'bin/debugger/lock_free_queue.h'
--- bin/debug_client/lock_free_queue.h	2011-07-01 01:53:24 +0000
+++ bin/debugger/lock_free_queue.h	2012-08-19 03:54:29 +0000
@@ -14,10 +14,14 @@
  * limitations under the License.
  */
 #pragma once
+#ifndef ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
+#define ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
+
 #include <iostream>
 #include <list>
 
-namespace zorba { namespace debugclient {
+
+namespace zorba { namespace debugger {
 
 template<typename T>
 class LockFreeProducer
@@ -80,4 +84,8 @@
   }
   return false;
 }
-}} // namespace zorba::debugclient
+
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H

=== modified file 'bin/debugger/main.cpp'
--- bin/debug_client/main.cpp	2011-07-01 01:53:24 +0000
+++ bin/debugger/main.cpp	2012-08-19 03:54:29 +0000
@@ -13,12 +13,288 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+#ifdef WIN32
+# include <windows.h>
+# include <string.h>
+# include <strsafe.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <vector>
+
 #include <zorba/config.h>
-#include "debug_command.h"
-#include "command_line_handler.h"
+
+#include "xqdb_client.h"
+#include "process_listener.h"
+
 
 using namespace zorba;
-using namespace zorba::debugclient;
+using namespace zorba::debugger;
+
+
+std::auto_ptr<XqdbClient> theClient;
+
+// this will make sure the xqdb process will not quit when Ctrl-C is pressed
+#ifdef WIN32
+BOOL WINAPI
+ctrlC_Handler(DWORD aCtrlType)
+{
+  if (CTRL_C_EVENT == aCtrlType) {
+    return true;
+  }
+  return false;
+}
+#else
+void
+ctrlC_Handler(int lParam)
+{
+  // an empty sugnal handler on Linux should do the job
+}
+#endif
+
+
+// this handler function is passed the the zorba process listener and will
+// the client if the zorba process terminates
+void
+onExitProcess(ExitCode aExitCode) {
+  std::cout << std::endl << "Terminating debugger client." << std::endl;
+
+#ifndef WIN32
+  XqdbClient* lClient = theClient.release();
+  if (lClient) {
+    delete lClient;
+  }
+#endif
+
+  exit(aExitCode);
+}
+
+
+int
+startZorba(std::string& aExec, std::vector<std::string>& aArgs, std::auto_ptr<ProcessListener>& aProcessListener) 
+{
+#ifdef WIN32
+  // **************************
+  // start a process on Windows
+
+  DWORD iReturnVal = 0;
+
+  std::wstring lExec;
+  std::wstring lArgs;
+
+  lExec.assign(aExec.begin(), aExec.end());
+
+  // the executable must be the first in the list of arguments
+  lArgs.append(L"\"");
+  lArgs.append(lExec);
+  lArgs.append(L"\"");
+
+  for (std::vector<std::string>::size_type j = 0; j < aArgs.size(); j++) {
+    std::string lArg(aArgs.at(j));
+    std::wstring lArgW;
+    lArgW.assign(lArg.begin(), lArg.end());
+    lArgs.append(L" ");
+    lArgs.append(lArgW);
+  }
+
+  // CreateProcessW can modify Parameters thus we allocate needed memory
+  wchar_t * pwszParam = new wchar_t[lArgs.size() + 1];
+  if (pwszParam == 0) {
+    return 1;
+  }
+  const wchar_t* pchrTemp = lArgs.c_str();
+  wcscpy_s(pwszParam, lArgs.size() + 1, pchrTemp); 
+
+  // CreateProcess API initialization
+  STARTUPINFOW siStartupInfo;
+  PROCESS_INFORMATION piProcessInfo;
+  memset(&siStartupInfo, 0, sizeof(siStartupInfo));
+  memset(&piProcessInfo, 0, sizeof(piProcessInfo));
+  siStartupInfo.cb = sizeof(siStartupInfo);
+
+  BOOL lResult = CreateProcessW(
+    const_cast<LPCWSTR>(lExec.c_str()),
+    pwszParam, 0, 0, false,
+    CREATE_DEFAULT_ERROR_MODE, 0, 0,
+    &siStartupInfo, &piProcessInfo);
+
+  if (lResult) {
+    // Watch the process
+    aProcessListener.reset(new ProcessListener(piProcessInfo.dwProcessId, &onExitProcess));
+  }
+  else {
+    // CreateProcess failed
+    iReturnVal = GetLastError();
+    LPVOID lpMsgBuf;
+    LPVOID lpDisplayBuf;
+
+    FormatMessage(
+      FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+      NULL,
+      iReturnVal,
+      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+      (LPTSTR) &lpMsgBuf,
+      0, NULL);
+
+    // Display the error message and exit the process
+
+    lpDisplayBuf = (LPVOID)LocalAlloc(
+      LMEM_ZEROINIT,
+      (lstrlen((LPCTSTR)lpMsgBuf) + 40) * sizeof(TCHAR));
+
+    StringCchPrintf(
+      (LPTSTR)lpDisplayBuf,
+      LocalSize(lpDisplayBuf) / sizeof(TCHAR),
+      TEXT("Error (%d) when starting zorba: %s"),
+      iReturnVal,
+      lpMsgBuf);
+
+    std::wstring lErrorW((wchar_t*)lpDisplayBuf);
+    std::string lError;
+    lError.assign(lErrorW.begin(), lErrorW.end());
+    std::cout << lError << std::endl;
+
+    LocalFree(lpMsgBuf);
+    LocalFree(lpDisplayBuf);
+  }
+
+  // Free memory
+  delete[]pwszParam;
+  pwszParam = 0;
+
+  // Release handles
+  CloseHandle(piProcessInfo.hProcess);
+  CloseHandle(piProcessInfo.hThread);
+
+  return iReturnVal; 
+
+#else
+  // ************************
+  // start a process on Linux
+
+  pid_t pID = fork();
+  if (pID == 0) {
+    // Code only executed by child process
+    std::stringstream lCommand;
+    lCommand << aExec;
+    for (std::vector<std::string>::size_type j = 0; j < aArgs.size(); j++) {
+      lCommand << " " << aArgs.at(j);
+    }
+
+    int lRes = system(lCommand.str().c_str());
+    exit(lRes);
+  }
+  else {
+    // Code only executed by parent process
+    if (pID < 0) {
+      std::cerr << "Failed to fork Zorba" << std::endl;
+      return pID;
+    }
+    
+    // Watch the process
+    aProcessListener.reset(new ProcessListener(pID, &onExitProcess));
+
+    return 0;
+  }
+#endif
+}
+
+void printUsage(std::string& aProgram)
+{
+  std::cerr << "Usage:" << std::endl
+    << "    " << aProgram << " <zorba_arguments>" << std::endl
+    << "        this will start a debugger command line and a zorba process with the given arguments" << std::endl;
+}
+
+bool
+processArguments(
+  int argc,
+  char* argv[],
+  std::string& aProgram,
+  bool& aStandalone,
+  std::string& aZorba,
+  unsigned int& aPort,
+  std::vector<std::string>& aZorbaArgs)
+{
+  aPort = 28028;
+
+  // find the path to Zorba and this executable name
+  aProgram = argv[0];
+
+#ifdef WIN32
+  char lSep = '\\';
+#else
+  char lSep = '/';
+#endif
+  std::string::size_type lPos = aProgram.find_last_of(lSep);
+
+  std::stringstream lZs;
+
+  if (lPos == aProgram.npos) {
+    lZs << "." << lSep;
+  } else {
+    lZs << aProgram.substr(0, lPos + 1);
+    aProgram = aProgram.substr(lPos + 1);
+  }
+  lZs << "zorba";
+#ifdef WIN32
+  lZs << ".exe";
+#endif
+  aZorba = lZs.str();
+
+
+  bool lHasFileArg = false;
+  bool lHasQueryArg = false;
+  bool lHasQueryVal = false;
+
+  // find if the user asked for help or specified a specific port
+  for (int i = 1; i < argc; i++) {
+    std::string lArg = argv[i];
+    if (lArg == "-h" || lArg == "--help") {
+      return false;
+    }
+    else if (lArg == "-p" || lArg == "--debug-port") {
+      // if there is one more argument
+      if (i < argc - 1) {
+        // get the port value
+        int lPort;
+        std::stringstream lStream(argv[i + 1]);
+        lStream >> lPort;
+        if (!lStream.fail()) {
+          aPort = lPort;
+        }
+      }
+    }
+    else if (lArg == "-f") {
+      lHasFileArg = true;
+    }
+    else if (lArg == "-q") {
+      lHasQueryArg = true;
+      if (++i < argc) {
+        lHasQueryVal = true;
+      }
+    }
+  }
+
+  if (!lHasFileArg || !lHasQueryArg || !lHasQueryVal) {
+    std::cout << "Not enough arguments to start Zorba." << std::endl;
+    std::cout << "Running the standalone XQuery debugger client on port: " << aPort << std::endl;
+    return true;
+  }
+
+  // zorba will need the -d flag
+  aZorbaArgs.push_back("-d");
+
+  // gather all arguments (excepting the program name)
+  for (int i = 1; i < argc; i++) {
+    aZorbaArgs.push_back(argv[i]);
+  }
+
+  aStandalone = false;
+  return true;
+}
 
 #ifndef _WIN32_WCE
 int
@@ -28,24 +304,72 @@
 _tmain(int argc, _TCHAR* argv[])
 #endif
 {
-  int port = 28028;
-  if (argv[1]) {
-    std::stringstream stream(argv[1]);
-    stream >> port;
-    if (stream.fail() || argv[2]) {
-      std::cerr << "Unknown argument. USAGE: " << argv[0] << " [PORT]" << std::endl;
-      return 2;
+#ifdef WIN32
+  SetConsoleCtrlHandler(ctrlC_Handler, TRUE);
+#else
+  signal(SIGINT, ctrlC_Handler);
+#endif
+
+  // **************************************************************************
+  // processing arguments
+
+  std::string lProgram, lZorbaExec;
+  unsigned int lPort = 28028;
+  std::vector<std::string> lZorbaArgs;
+
+  bool lStandalone = true;
+  if (!processArguments(argc, argv, lProgram, lStandalone, lZorbaExec, lPort, lZorbaArgs)) {
+    printUsage(lProgram);
+    return 1;
+  }
+
+#ifndef NDEBUG
+  // **************************************************************************
+  // debug reporting
+
+  if (!lStandalone) {
+    std::cout << "Communication port: " << lPort << std::endl;
+    std::cout << "Zorba executable:   " << lZorbaExec << std::endl;
+    std::cout << "Zorba arguments:    ";
+    for (std::vector<std::string>::size_type j = 0; j < lZorbaArgs.size(); j++) {
+      std::cout << lZorbaArgs.at(j) << " ";
     }
+    std::cout << std::endl;
   }
+#endif
+
   try {
-    LockFreeQueue<std::size_t> lQueue;
-    LockFreeQueue<bool> lContEvent;
-    EventHandler lHandler(lQueue, lContEvent);
-    CommandLine cli;
-    CommandLineHandler handler(port, lQueue, lContEvent, lHandler, cli);
-    handler.execute();
+    // **************************************************************************
+    // start a zorba
+
+    // This is a process listener used to watch the Zorba process termination.
+    std::auto_ptr<ProcessListener> lProcessListener;
+
+    if (!lStandalone) {
+      int lResult = startZorba(lZorbaExec, lZorbaArgs, lProcessListener);
+      if (lResult) {
+        return lResult;
+      }
+    } else {
+      std::cout << "Listening for an incomming Zorba connection on port " << lPort << "..." << std::endl;
+    }
+
+    // **************************************************************************
+    // start the debugger command line
+
+    theClient.reset(new XqdbClient(lPort));
+    theClient->start();
+
   } catch (...) {
-    return 4;
-  }
+    return -1;
+  }
+
+#ifndef WIN32
+  XqdbClient* lClient = theClient.release();
+  if (lClient) {
+    delete lClient;
+  }
+#endif
+
   return 0;
 }

=== added file 'bin/debugger/process_listener.cpp'
--- bin/debugger/process_listener.cpp	1970-01-01 00:00:00 +0000
+++ bin/debugger/process_listener.cpp	2012-08-19 03:54:29 +0000
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+#include "process_listener.h"
+
+#include <iostream>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+# include <cassert>
+#endif
+
+
+namespace zorba { namespace debugger {
+  
+ProcessListener::ProcessListener(ProcessId aProcessID, ExitCallbackType aCallback)
+  : theProcessID(aProcessID), theCallback(aCallback)
+{
+#ifdef WIN32
+  theThread = CreateThread(NULL, 0, &run, (void*) this, 0, &theThreadId);
+#else
+  if (pthread_create(&theThread, NULL, &run, (void*) this)) {
+    assert(false);
+  }
+#endif
+}
+
+ProcessListener::~ProcessListener()
+{
+}
+
+ProcessId
+ProcessListener::getProcessID()
+{
+  return theProcessID;
+}
+
+ExitCallbackType
+ProcessListener::getCallback()
+{
+  return theCallback;
+}
+
+
+ZORBA_THREAD_RETURN
+ProcessListener::run(void* params)
+{
+  ProcessListener* lThis = static_cast<ProcessListener*>(params);
+  ExitCode lExitCode = -1;
+  ProcessId lPid = lThis->getProcessID();
+
+#ifdef WIN32
+  HANDLE lProcessHandle = OpenProcess(SYNCHRONIZE, false, lPid);
+  if (lProcessHandle != NULL) {
+    // wait for the process to exit
+    DWORD lResult = WaitForSingleObject(lProcessHandle, INFINITE);
+ 
+    // find out the process exit code if possible
+    if (!GetExitCodeProcess(lProcessHandle, &lExitCode)) {
+      lExitCode = -1;
+    }
+    DWORD dw = GetLastError();
+ 
+    // wait a little for zorba to dump the garbage
+    Sleep(1000);
+  }
+#else
+  int lChildExitStatus;
+
+  // wait for the process to exit
+  waitpid(lPid, &lChildExitStatus, 0);
+
+  // find out the process exit code if possible
+  if (WIFEXITED(lChildExitStatus)) {
+    lExitCode = WEXITSTATUS(lChildExitStatus);
+  }
+
+  // wait a little for zorba to dump the garbage
+  sleep(1);
+#endif
+
+  // and call the callback when this happened
+  ExitCallbackType lCallback = lThis->getCallback();
+  lCallback(lExitCode);
+
+  for (int i = 0; i < 10; i++) {
+    std::cout << i << std::endl;
+  }
+  return NULL;
+}
+
+} // namespace zorba
+} // namespace debugger

=== added file 'bin/debugger/process_listener.h'
--- bin/debugger/process_listener.h	1970-01-01 00:00:00 +0000
+++ bin/debugger/process_listener.h	2012-08-19 03:54:29 +0000
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_PROCESS_LISTENER_H
+#define ZORBA_DEBUGGER_PROCESS_LISTENER_H
+
+#include <zorba/config.h>
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+# include <pthread.h>
+# include <sys/wait.h>
+  typedef pthread_t ThreadId;
+  typedef pid_t ProcessId;
+  typedef int ExitCode;
+# define ZORBA_THREAD_RETURN void *
+#else
+# include <windows.h>
+  typedef DWORD ThreadId;
+  typedef DWORD ProcessId;
+  typedef DWORD ExitCode;
+# define ZORBA_THREAD_RETURN DWORD WINAPI
+#endif
+
+typedef void (*ExitCallbackType)(ExitCode);
+
+
+namespace zorba { namespace debugger {
+
+class ProcessListener
+{
+  public:
+    ProcessListener(ProcessId processID, ExitCallbackType callback);
+
+    ~ProcessListener();
+
+    ProcessId
+    getProcessID();
+
+    ExitCallbackType
+    getCallback();
+
+  private:
+
+    static ZORBA_THREAD_RETURN run(void* params);
+
+  private:
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+    pthread_t         theThread;
+#else
+    ThreadId          theThreadId;
+    HANDLE            theThread;
+#endif
+
+    ProcessId         theProcessID;
+    ExitCallbackType  theCallback;
+};
+  
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_PROCESS_LISTENER_H

=== modified file 'bin/debugger/tuple.h'
--- bin/debug_client/tuple.h	2011-07-04 08:05:46 +0000
+++ bin/debugger/tuple.h	2012-08-19 03:54:29 +0000
@@ -14,9 +14,15 @@
  * limitations under the License.
  */
 #pragma once
+#ifndef ZORBA_DEBUGGER_TUPLE_H
+#define ZORBA_DEBUGGER_TUPLE_H
+
 #include <zorba/config.h>
+
 #if ZORBA_TR1_IN_TR1_SUBDIRECTORY
 # include <tr1/tuple>
 #else
 # include <tuple>
 #endif
+
+#endif // ZORBA_DEBUGGER_TUPLE_H

=== added file 'bin/debugger/xqdb_client.cpp'
--- bin/debugger/xqdb_client.cpp	1970-01-01 00:00:00 +0000
+++ bin/debugger/xqdb_client.cpp	2012-08-19 03:54:29 +0000
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+#include "xqdb_client.h"
+
+#include <iostream>
+
+#ifdef ZORBA_HAVE_PTHREAD_H
+# include <cassert>
+#endif
+
+
+namespace zorba { namespace debugger {
+
+XqdbClient::XqdbClient(unsigned int aPort)
+{
+  theIdQueue = new LockFreeQueue<std::size_t>();
+  theQuitQueue = new LockFreeQueue<bool>();
+  theEventHandler = new EventHandler(*theIdQueue, *theQuitQueue);
+  theEventHandler->init();
+
+  theCommandPrompt = new CommandPrompt();
+  theCommandLineHandler = new CommandLineHandler(aPort, *theIdQueue, *theQuitQueue, theEventHandler, theCommandPrompt);
+}
+
+XqdbClient::~XqdbClient()
+{
+  if (theCommandLineHandler) {
+    delete theCommandLineHandler;
+  }
+  if (theCommandPrompt) {
+    delete theCommandPrompt;
+  }
+  if (theEventHandler) {
+    delete theEventHandler;
+  }
+
+  delete theIdQueue;
+  delete theQuitQueue;
+}
+
+void
+XqdbClient::start()
+{
+  theCommandLineHandler->execute();
+}
+
+
+} // namespace zorba
+} // namespace debugger

=== added file 'bin/debugger/xqdb_client.h'
--- bin/debugger/xqdb_client.h	1970-01-01 00:00:00 +0000
+++ bin/debugger/xqdb_client.h	2012-08-19 03:54:29 +0000
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+#pragma once
+#ifndef ZORBA_DEBUGGER_XQDB_CLIENT_H
+#define ZORBA_DEBUGGER_XQDB_CLIENT_H
+
+#include "command_prompt.h"
+#include "command_line_handler.h"
+
+
+namespace zorba { namespace debugger {
+
+class XqdbClient {
+
+  public:
+
+    XqdbClient(unsigned int aPort);
+
+    ~XqdbClient();
+
+    void
+    start();
+
+  private:
+
+    LockFreeQueue<std::size_t>* theIdQueue;
+    LockFreeQueue<bool>*        theQuitQueue;
+
+    EventHandler*       theEventHandler;
+    CommandPrompt*      theCommandPrompt;
+    CommandLineHandler* theCommandLineHandler;
+};
+
+  
+} // namespace zorba
+} // namespace debugger
+
+#endif // ZORBA_DEBUGGER_XQDB_CLIENT_H

=== renamed file 'bin/module_path.cpp' => 'bin/path_util.cpp'
--- bin/module_path.cpp	2011-05-25 16:40:26 +0000
+++ bin/path_util.cpp	2012-08-19 03:54:29 +0000
@@ -14,85 +14,117 @@
  * limitations under the License.
  */
 
-#include "module_path.h"
+#include "path_util.h"
 
 #include <stdlib.h>
-#include "zorba/zorba_string.h"
+//#include "zorba/zorba_string.h"
 #include "zorba/util/path.h"
 
 #include "util.h"
 #include "zorbacmdproperties.h"
+#include <zorba/static_context.h>
 
 namespace zorba {
 
-std::string
-ModulePath::getEnvironmentModulePath()
+namespace PathUtil {
+
+static std::string
+getPathFromEnvironment(std::string const& aEnvVar)
 {
-  std::string lEnvName("ZORBA_MODULE_PATH");
 #ifdef WIN32
   char* lBuffer;
   size_t lLen=0;
-  errno_t lErr = getenv_s(&lLen, NULL, 0, lEnvName.c_str());
+  errno_t lErr = getenv_s(&lLen, NULL, 0, aEnvVar.c_str());
   if (lErr || !lLen) return "";
   lBuffer = (char*)malloc(lLen * sizeof(char));
   if (!lBuffer) return "";
-  getenv_s(&lLen, lBuffer, lLen, lEnvName.c_str());
+  getenv_s(&lLen, lBuffer, lLen, aEnvVar.c_str());
   std::string lRes(lBuffer);
   free(lBuffer);
   return lRes;
 #else
-  const char* lEnvValue = getenv(lEnvName.c_str());
-  return lEnvValue!=0?lEnvValue:"";
+  const char* lEnvValue = getenv(aEnvVar.c_str());
+  return lEnvValue != 0 ? lEnvValue : "";
 #endif
 }
 
-void
-ModulePath::convertVector(
-  const std::vector<std::string>& aSource,
-  std::vector<String>&            aDest)
-{
-  for (std::vector<std::string>::const_iterator lIter = aSource.begin();
-       lIter != aSource.end(); ++lIter) {
-    aDest.push_back(*lIter);
-  } 
-}
 
 void
-ModulePath::tokenizeModulePath(
-  const std::string&        aModulePath,
-  std::vector<std::string>& aResult)
+tokenizePath(
+  const std::string&    aPathStr,
+  std::vector<String>&  aResult)
 {
+  std::vector<std::string> lPath;
 #ifdef WIN32
-  Util::tokenize(aModulePath, ";", aResult);
+  Util::tokenize(aPathStr, ";", lPath);
 #else
-  Util::tokenize(aModulePath, ":", aResult);
+  Util::tokenize(aPathStr, ":", lPath);
 #endif
-}
+  for (std::vector<std::string>::iterator lIter = lPath.begin();
+       lIter != lPath.end(); ++lIter) {
+    aResult.push_back(*lIter);
+  }
+}
+
+
+String
+concatenatePaths( const std::vector<String>& aPathList)
+{
+  String delimiter(filesystem_path::get_path_separator());
+
+  String lResult;
+  for (std::vector<String>::const_iterator lIter = aPathList.begin();
+       lIter != aPathList.end(); ++lIter)
+  {
+    lResult += delimiter + *lIter;
+  }
+
+  return lResult;
+}
+
 
 void
-ModulePath::getModulePaths(
+setPathsOnContext(
   const ZorbaCMDProperties& aProperties,
-  std::vector<String>&      aModulePaths)
+  StaticContext_t& aStaticCtx)
 {
-  std::vector<std::string> lModulePaths; // result vector
-  std::string lModulePath; // temporary variable for collections paths
-
-  // 1. add the module paths from the command line properties
-  aProperties.getModulePaths(lModulePath);
-
-  tokenizeModulePath(lModulePath, lModulePaths);
-
-  // 2. add the module paths from the environment
-  lModulePath = ModulePath::getEnvironmentModulePath();
-
-  tokenizeModulePath(lModulePath, lModulePaths);
-
-  // 3. add the current working directory as module path
+  std::vector<String> lPath;
+  std::string lPathStr, lEnvStr;
+
+  // Compute the current working directory to append to all paths.
   filesystem_path lCWD;
-  lModulePaths.push_back(lCWD.get_path());
-
-  // convert std::string to zorba::String
-  convertVector(lModulePaths, aModulePaths);
+
+  // setModulePaths() *overwrites* the URI path and lib path, so there's no
+  // sense in calling both. So if either --module-path or ZORBA_MODULE_PATH
+  // exists, just use those.
+  aProperties.getModulePath(lPathStr);
+  lEnvStr = getPathFromEnvironment("ZORBA_MODULE_PATH");
+  if (lPathStr.length() > 0 || lEnvStr.length() > 0) {
+    tokenizePath(lPathStr, lPath);
+    tokenizePath(lEnvStr, lPath);
+    lPath.push_back(lCWD.get_path());
+    aStaticCtx->setModulePaths(lPath);
+  }
+  else {
+    // Compute and set URI path
+    aProperties.getURIPath(lPathStr);
+    tokenizePath(lPathStr, lPath);
+    lEnvStr = getPathFromEnvironment("ZORBA_URI_PATH");
+    tokenizePath(lEnvStr, lPath);
+    lPath.push_back(lCWD.get_path());
+    aStaticCtx->setURIPath(lPath);
+    lPath.clear();
+
+    // Compute and set lib path
+    aProperties.getLibPath(lPathStr);
+    tokenizePath(lPathStr, lPath);
+    lPath.push_back(lCWD.get_path());
+    lEnvStr = getPathFromEnvironment("ZORBA_LIB_PATH");
+    tokenizePath(lEnvStr, lPath);
+    aStaticCtx->setLibPath(lPath);
+  }
 }
 
+} /* namespace ModulePath */
+
 } /* namespace zorba */

=== renamed file 'bin/module_path.h' => 'bin/path_util.h'
--- bin/module_path.h	2010-02-12 08:57:04 +0000
+++ bin/path_util.h	2012-08-19 03:54:29 +0000
@@ -18,6 +18,7 @@
 
 #include <vector>
 #include <string>
+#include <zorba/api_shared_types.h>
 
 class ZorbaCMDProperties;
 
@@ -25,30 +26,20 @@
 
   class String;
 
-  class ModulePath {
-  protected:
-    static std::string
-    getEnvironmentModulePath();
-
-    static void
-    convertVector(const std::vector<std::string>& aSource,
-                  std::vector<String>& aDest); 
-
-    static void
-    tokenizeModulePath(const std::string& aModulePath,
-                       std::vector<std::string>& aResult);
-
-    static void
-    getInstalledModulePath(const std::string& aModulePath,
-                       std::vector<std::string>& aResult);
-
-  public:
-    static void
-    getModulePaths(const ZorbaCMDProperties& aProperties,
-                   std::vector<String>& aModulePaths);
-
-
-  };
+  namespace PathUtil {
+
+    void
+    setPathsOnContext(const ZorbaCMDProperties& aProperties,
+                      zorba::StaticContext_t& aStaticCtx);
+
+    void
+    tokenizePath(const std::string& aPathStr, std::vector<String>&  aResult);
+
+
+    String
+    concatenatePaths( const std::vector<String>& aPathList);
+
+  }
 } /* namespace zorba */
 
 #endif

=== modified file 'bin/test/mymod.xq'
--- bin/test/mymod.xq	2011-08-05 02:21:55 +0000
+++ bin/test/mymod.xq	2012-08-19 03:54:29 +0000
@@ -14,7 +14,7 @@
  : limitations under the License.
 :)
 
-module namespace foo = "http://www.28msec.com/foo";;
+module namespace foo = "http://www.zorba-xquery.com/foo";;
 
 declare function foo:test() {
   if (fn:true())

=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp	2011-07-11 11:12:23 +0000
+++ bin/zorbacmd.cpp	2012-08-19 03:54:29 +0000
@@ -38,12 +38,19 @@
 #include <zorba/iterator.h>
 #include <zorba/xquery_functions.h>
 #include <zorba/uri_resolvers.h>
-
+#include <zorba/serialization_callback.h>
 #include <zorba/store_manager.h>
 
+//#define DO_AUDIT
+
+#ifdef DO_AUDIT
+#include <zorba/audit.h>
+#include <zorba/audit_scoped.h>
+#endif
+
 #include "error_printer.h"
 #include "util.h"
-#include "module_path.h"
+#include "path_util.h"
 
 // For setting the base URI from the current directory
 #include <zorba/util/path.h>
@@ -70,13 +77,35 @@
 
 #ifndef ZORBA_NO_FULL_TEXT
 OneToOneURIMapper theStopWordsMapper(EntityData::STOP_WORDS);
-OneToOneURIMapper theThesaurusMapper(EntityData::THESAURUS, URIMapper::COMPONENT);
+OneToOneURIMapper theThesaurusMapper(EntityData::THESAURUS);
 #endif
 
-bool
-populateStaticContext(
-    zorba::StaticContext_t& aStaticContext,
-    const ZorbaCMDProperties& aProperties)
+
+/*******************************************************************************
+
+********************************************************************************/
+class URIMapperSerializationCallback : public SerializationCallback
+{
+private:
+  std::vector<URIMapper*>   theURIMappers;
+
+public:
+  void addURIMapper(URIMapper* mapper) { theURIMappers.push_back(mapper); }
+
+  URIMapper* getURIMapper(size_t i) const { return theURIMappers[i]; }
+};
+
+
+URIMapperSerializationCallback theSerializationCallback;
+
+
+/*******************************************************************************
+
+********************************************************************************/
+bool populateStaticContext(
+    Zorba* zorba,
+    zorba::StaticContext_t& sctx,
+    const ZorbaCMDProperties& props)
 {
   try
   {
@@ -85,103 +114,133 @@
     // 2. environment ZORBA_MODULE_PATH
     // 3. current working directory
     {
-      std::vector<String> lModulePaths;
-      ModulePath::getModulePaths(aProperties, lModulePaths);
-
-      aStaticContext->setModulePaths(lModulePaths);
-    }
-
-    if (aProperties.boundarySpace().size() != 0 )
-      aStaticContext->setBoundarySpacePolicy(
-                         (aProperties.boundarySpace().compare("preserve") == 0
-                          ? preserve_space
-                          : strip_space));
-
-    if (aProperties.constructionMode().size() != 0)
-      aStaticContext->setConstructionMode( aProperties.boundarySpace().compare("preserve") == 0
-                                           ? preserve_cons
-                                           : strip_cons );
-
-    if (aProperties.orderingMode().size() != 0 )
-    {
-      aStaticContext->setOrderingMode( aProperties.boundarySpace().compare("ordered") == 0
-                                       ? ordered
-                                       : unordered );
-    }
-
-    if (aProperties.baseUri().size() != 0 )
-      aStaticContext->setBaseURI( aProperties.baseUri() );
+      std::vector<String> lModulePath;
+      PathUtil::setPathsOnContext(props, sctx);
+    }
+
+    if (props.boundarySpace().size() != 0 )
+    {
+      sctx->setBoundarySpacePolicy(props.boundarySpace().compare("preserve") == 0 ?
+                                   preserve_space : 
+                                   strip_space);
+    }
+
+    if (props.constructionMode().size() != 0)
+    {
+      sctx->setConstructionMode(props.boundarySpace().compare("preserve") == 0 ? 
+                                preserve_cons :
+                                strip_cons);
+    }
+
+    if (props.orderingMode().size() != 0 )
+    {
+      sctx->setOrderingMode(props.boundarySpace().compare("ordered") == 0 ?
+                            ordered :
+                            unordered);
+    }
+
+    if (props.baseUri().size() != 0 )
+      sctx->setBaseURI( props.baseUri() );
   }
-  catch (zorba::ZorbaException const& ze) {
+  catch (const zorba::ZorbaException& ze) 
+  {
     std::cerr << ze << std::endl;
     return false;
   }
 
-  if (aProperties.defaultCollation().size() != 0 )
-  {
-    try {
-      aStaticContext->addCollation( aProperties.defaultCollation() );
-    } catch (zorba::ZorbaException const&) {
-      std::cerr << "the given collation {" << aProperties.defaultCollation() << "} is not a valid collation." << std::endl;
-      return false;
-    }
-    aStaticContext->setDefaultCollation( aProperties.defaultCollation() );
-  }
-
-  {
-    ZorbaCMDProperties::Options_t::const_iterator lIter = aProperties.optionsBegin();
-    ZorbaCMDProperties::Options_t::const_iterator end = aProperties.optionsEnd();
-    for (; lIter != end; ++lIter)
-    {
-      try {
-        zorba::Zorba* lZorba = zorba::Zorba::getInstance(0);
-        Item lQName = lZorba->getItemFactory()->createQName(lIter->clark_qname);
-        aStaticContext->declareOption(lQName, lIter->value);
-      } catch (zorba::ZorbaException const& /* e */) {
-        std::cerr << "unable to set static context option with qname "
-                  << lIter->clark_qname << std::endl;
-        return false;
-      }
-    }
-  }
+  if (props.defaultCollation().size() != 0 )
+  {
+    try 
+    {
+      sctx->addCollation( props.defaultCollation() );
+    }
+    catch (zorba::ZorbaException const&)
+    {
+      std::cerr << "the given collation {" << props.defaultCollation()
+                << "} is not a valid collation." << std::endl;
+      return false;
+    }
+
+    sctx->setDefaultCollation( props.defaultCollation() );
+  }
+
+  ZorbaCMDProperties::Options_t::const_iterator lIter = props.optionsBegin();
+  ZorbaCMDProperties::Options_t::const_iterator end = props.optionsEnd();
+  for (; lIter != end; ++lIter)
+  {
+    try 
+    {
+      Item lQName = zorba->getItemFactory()->createQName(lIter->clark_qname);
+      sctx->declareOption(lQName, lIter->value);
+    }
+    catch (zorba::ZorbaException const& /* e */) 
+    {
+      std::cerr << "unable to set static context option with qname "
+                << lIter->clark_qname << std::endl;
+      return false;
+    }
+  }
+
 #ifndef ZORBA_NO_FULL_TEXT
   {
-    ZorbaCMDProperties::FullText_t::const_iterator lIter = aProperties.stopWordsBegin();
-    ZorbaCMDProperties::FullText_t::const_iterator end = aProperties.stopWordsEnd();
-    for (; lIter != end; ++lIter) {
+    ZorbaCMDProperties::FullText_t::const_iterator lIter = props.stopWordsBegin();
+    ZorbaCMDProperties::FullText_t::const_iterator end = props.stopWordsEnd();
+    for (; lIter != end; ++lIter) 
+    {
       theStopWordsMapper.addMapping(lIter->uri, lIter->value);
     }
-    aStaticContext->registerURIMapper(&theStopWordsMapper);
+
+    if (props.serializePlan() || props.loadPlan()) 
+    {
+      theSerializationCallback.addURIMapper(&theStopWordsMapper);
+    }
+    else
+    {
+      sctx->registerURIMapper(&theStopWordsMapper);
+    }
   }
+
   {
-    ZorbaCMDProperties::FullText_t::const_iterator lIter = aProperties.thesaurusBegin();
-    ZorbaCMDProperties::FullText_t::const_iterator end = aProperties.thesaurusEnd();
-    for (; lIter != end; ++lIter) {
+    ZorbaCMDProperties::FullText_t::const_iterator lIter = props.thesaurusBegin();
+    ZorbaCMDProperties::FullText_t::const_iterator end = props.thesaurusEnd();
+    for (; lIter != end; ++lIter) 
+    {
       theThesaurusMapper.addMapping(lIter->uri, lIter->value);
     }
-    aStaticContext->registerURIMapper(&theThesaurusMapper);
+
+    if (props.serializePlan() || props.loadPlan())
+    {
+      theSerializationCallback.addURIMapper(&theStopWordsMapper);
+    }
+    else
+    {
+      sctx->registerURIMapper(&theThesaurusMapper);
+    }
   }
 #endif
   return true;
 }
 
 
-bool
-populateDynamicContext(
-  Zorba* zorba,
-  zorba::DynamicContext* aDynamicContext,
-  const ZorbaCMDProperties& aProperties)
+/*******************************************************************************
+
+********************************************************************************/
+bool populateDynamicContext(
+    Zorba* zorba,
+    zorba::DynamicContext* aDynamicContext,
+    const ZorbaCMDProperties& props)
 {
-  XmlDataManager* lXmlMgr = zorba->getXmlDataManager();
-  if ( aProperties.contextItem().size() != 0 ) {
-    std::ifstream lInStream(aProperties.contextItem().c_str());
+  if ( props.contextItem().size() != 0 ) 
+  {
+    XmlDataManager* lXmlMgr = zorba->getXmlDataManager();
+    std::ifstream lInStream(props.contextItem().c_str());
     Item lDoc = lXmlMgr->parseXML(lInStream);
     aDynamicContext->setContextItem(lDoc);
   }
 
   ZorbaCMDProperties::ExternalVars_t::const_iterator lIter;
-  ZorbaCMDProperties::ExternalVars_t::const_iterator end = aProperties.externalVarsEnd();
-  for (lIter = aProperties.externalVarsBegin();
+  ZorbaCMDProperties::ExternalVars_t::const_iterator end = props.externalVarsEnd();
+  for (lIter = props.externalVarsBegin();
        lIter != end;
        ++lIter)
   {
@@ -189,6 +248,7 @@
     {
       if ((*lIter).inline_file)
       {
+        XmlDataManager* lXmlMgr = zorba->getXmlDataManager();
         std::ifstream lInStream((*lIter).var_value.c_str());
         Item lDoc = lXmlMgr->parseXML(lInStream);
         aDynamicContext->setVariable((*lIter).var_name, lDoc);
@@ -212,34 +272,36 @@
 }
 
 
-bool
-createSerializerOptions(
+/*******************************************************************************
+
+********************************************************************************/
+bool createSerializerOptions(
     Zorba_SerializerOptions_t& lSerOptions,
-    const ZorbaCMDProperties& aProperties)
+    const ZorbaCMDProperties& props)
 {
-  if ( aProperties.indent() )
+  if ( props.indent() )
     lSerOptions.indent = ZORBA_INDENT_YES;
 
-  if ( aProperties.omitXmlDeclaration() )
+  if ( props.omitXmlDeclaration() )
     lSerOptions.omit_xml_declaration = ZORBA_OMIT_XML_DECLARATION_YES;
 
-  if ( aProperties.byteOrderMark() )
+  if ( props.byteOrderMark() )
     lSerOptions.byte_order_mark = ZORBA_BYTE_ORDER_MARK_YES;
 
-  if ( aProperties.serializeHtml() )
+  if ( props.serializeHtml() )
     lSerOptions.ser_method = ZORBA_SERIALIZATION_METHOD_HTML;
-  else if ( aProperties.serializeText() )
+  else if ( props.serializeText() )
     lSerOptions.ser_method = ZORBA_SERIALIZATION_METHOD_TEXT;
 
   return true;
 }
 
 
-/// Fullfills the command-line "as-file" (-f) switch,
-/// or if not requested, infers -f for file:// queries.
-/// Returns an URI or the empty string.
-std::string
-parseFileURI (bool asPath, const std::string &str)
+/*******************************************************************************
+  Fullfills the command-line "as-file" (-f) switch, or if not requested, infers
+  -f for file:// queries. Returns an URI or the empty string.
+********************************************************************************/
+std::string parseFileURI(bool asPath, const std::string &str)
 {
   if (asPath)
     return str;
@@ -312,6 +374,8 @@
     COMP_TIMER,
     EXEC_TIMER,
     UNLOAD_TIMER,
+    PLAN_SAVE_TIMER,
+    PLAN_LOAD_TIMER,
     TOTAL_TIMER
   } TimerKind;
 
@@ -323,6 +387,8 @@
   DECLARE_TIMER(Exec);
   DECLARE_TIMER(Load);
   DECLARE_TIMER(Unload);
+  DECLARE_TIMER(PlanSave);
+  DECLARE_TIMER(PlanLoad);
   DECLARE_TIMER(Total);
 
   TimingInfo(unsigned long num)
@@ -340,6 +406,13 @@
     elapsedLoadCputime(0),
     elapsedUnloadWalltime(0),
     elapsedUnloadCputime(0),
+
+    elapsedPlanSaveWalltime(0),
+    elapsedPlanSaveCputime(0),
+
+    elapsedPlanLoadWalltime(0),
+    elapsedPlanLoadCputime(0),
+
     elapsedTotalWalltime(0),
     elapsedTotalCputime(0)
   {
@@ -348,7 +421,7 @@
   void startTimer(TimerKind kind, unsigned long iteration);
   void stopTimer(TimerKind kind, unsigned long iteration);
 
-  std::ostream& print(std::ostream& os);
+  std::ostream& print(std::ostream& os, bool);
 };
 
 
@@ -383,6 +456,14 @@
   case UNLOAD_TIMER:
     START_TIMER(Unload);
     break;
+
+  case PLAN_SAVE_TIMER:
+    START_TIMER(PlanSave);
+    break;
+
+  case PLAN_LOAD_TIMER:
+    START_TIMER(PlanLoad);
+    break;
   }
 }
 
@@ -425,12 +506,22 @@
     STOP_TIMER(Unload);
     break;
   }
+  case PLAN_SAVE_TIMER:
+  {
+    STOP_TIMER(PlanSave);
+    break;
+  }
+  case PLAN_LOAD_TIMER:
+  {
+    STOP_TIMER(PlanLoad);
+    break;
+  }
   }
 }
 
 
 std::ostream&
-TimingInfo::print(std::ostream& os)
+TimingInfo::print(std::ostream& os, bool serializePlan)
 {
   os.precision(3);
   os.setf(std::ios::fixed);
@@ -442,12 +533,16 @@
   double eWalltime = elapsedExecWalltime / timeDiv;
   double lWalltime = elapsedLoadWalltime / timeDiv;
   double uWalltime = elapsedUnloadWalltime / timeDiv;
+  double psWalltime = elapsedPlanSaveWalltime / timeDiv;
+  double plWalltime = elapsedPlanLoadWalltime / timeDiv;
   double tWalltime = elapsedTotalWalltime / timeDiv;
 
   double cCputime = elapsedCompCputime / timeDiv;
   double eCputime = elapsedExecCputime / timeDiv;
   double lCputime = elapsedLoadCputime / timeDiv;
   double uCputime = elapsedUnloadCputime / timeDiv;
+  double psCputime = elapsedPlanSaveCputime / timeDiv;
+  double plCputime = elapsedPlanLoadCputime / timeDiv;
   double tCputime = elapsedTotalCputime / timeDiv;
 
   os << "Engine Startup Time     : " << elapsedInitWalltime
@@ -458,6 +553,17 @@
      << " (user: " << cCputime << ")"
      << " milliseconds" << std::endl;
 
+  if (serializePlan)
+  {
+    os << "Average Plan Saving Time: " << psWalltime
+       << " (user: " << psCputime << ")"
+       << " milliseconds" << std::endl;
+    
+    os << "Average Plan Loading Time: " << plWalltime
+       << " (user: " << plCputime << ")"
+       << " milliseconds" << std::endl;
+  }
+
   os << "Average Execution Time  : " << eWalltime - lWalltime
      << " (user: " << eCputime - lCputime  << ")"
      << " milliseconds" << std::endl;
@@ -505,16 +611,59 @@
   unsigned long lNumExecutions = properties.multiple();
   bool lIndent = properties.indent();
   bool doTiming = properties.timing();
-
+  bool serializePlan = properties.serializePlan();
+  bool savePlan = properties.savePlan();
+  bool loadPlan = properties.loadPlan();
+  std::ostringstream lOut;
   Zorba_CompilerHints lHints;
 
+  std::auto_ptr<std::fstream> planFile;
+  std::fstream* planFilep = NULL;
+
+  if (serializePlan)
+  {
+    if (savePlan || loadPlan)
+    {
+      std::cerr << "The --serialize-plan option cannot be used together with the --compile-plan or --execute-plan options" << std::endl;
+      exit(1);
+    }
+
+    std::string planFilePath = qfilepath;
+    planFilePath += ".plan";
+    planFile.reset(new std::fstream(planFilePath.c_str(), 
+                                    std::fstream::in | 
+                                    std::fstream::out |
+                                    std::fstream::trunc |
+                                    std::fstream::binary));
+    planFilep = planFile.get();
+    assert(planFilep->good());
+  }
+
+  if (savePlan && loadPlan)
+  {
+    std::cerr << "The --compile-plan and --execute-plan options cannot be used together" << std::endl;
+    exit(1);
+  }
+
   // default is O1 in the Zorba_CompilerHints constructor
-  if (properties.optimizationLevel() == "O0") {
+  if (properties.optimizationLevel() == "O0") 
+  {
     lHints.opt_level = ZORBA_OPT_LEVEL_O0;
-  } else if (properties.optimizationLevel() == "O2") {
+  }
+  else if (properties.optimizationLevel() == "O2") 
+  {
     lHints.opt_level = ZORBA_OPT_LEVEL_O2;
   }
 
+  lHints.for_serialization_only = true;
+
+#if ZORBACMD_LOAD_SYSTEM_PROPERTIES
+  if (Properties::instance()->serializeOnlyQuery() == 0)
+  {
+    lHints.for_serialization_only = false;
+  }
+#endif
+
   // default is false
   if (properties.libModule())
   {
@@ -529,7 +678,14 @@
 
   for (unsigned long i = 0; i < lNumExecutions; ++i)
   {
-    // Perform compilation and create dynamic context only once, unless timing is needed
+    // start the total timer
+    if (doTiming)
+      timing.startTimer(TimingInfo::TOTAL_TIMER, i);
+    
+    //
+    // Compile the query
+    // Compilation is done only once, unless timing is needed
+    //
     if (doTiming || i == 0)
     {
       // go back to the beginning of the stream
@@ -537,33 +693,51 @@
       qfile.seekg(0);
       assert (qfile.tellg() >= 0);
 
-      if (doTiming)
-      {
-        // start the total timer
-        timing.startTimer(TimingInfo::TOTAL_TIMER, i);
-      }
-
-      //
-      // Compile the query
-      //
       try
       {
+        // start the compilation timer
         if (doTiming)
-        {
-          // start the compilation timer
           timing.startTimer(TimingInfo::COMP_TIMER, i);
-        }
 
+        // Create and compile the query
         query = zorbaInstance->createQuery();
         query->registerDiagnosticHandler(&diagnosticHandler);
         query->setFileName(qfilepath);
 
-        query->compile(qfile, staticContext, lHints);
-
-        if (doTiming)
-        {
-          // stop the compilation timer
-          timing.stopTimer(TimingInfo::COMP_TIMER, i);
+        if (loadPlan) 
+        {
+          query->loadExecutionPlan(qfile, &theSerializationCallback);
+
+          // stop the compilation timer
+          if (doTiming)
+            timing.stopTimer(TimingInfo::COMP_TIMER, i);
+        }
+        else
+        {
+          query->compile(qfile, staticContext, lHints);
+
+          // stop the compilation timer
+          if (doTiming)
+            timing.stopTimer(TimingInfo::COMP_TIMER, i);
+
+          // Serialize the execution plan, if requested
+          if (serializePlan) 
+          {
+            planFilep->clear();
+            planFilep->seekp(0);
+
+            // start the plan-save timer
+            if (doTiming)
+              timing.startTimer(TimingInfo::PLAN_SAVE_TIMER, i);
+
+            query->saveExecutionPlan(*planFilep, ZORBA_USE_BINARY_ARCHIVE);
+
+            // stop the plan-save timer
+            if (doTiming)
+              timing.stopTimer(TimingInfo::PLAN_SAVE_TIMER, i);
+
+            planFilep->flush();
+          }
         }
       }
       catch (zorba::XQueryException const& qe)
@@ -576,66 +750,85 @@
         std::cerr << ze << std::endl;
         return 12;
       }
-
-      // if (diagnosticHandler.
-
-      //
-      // Create and populate the dynamic context
-      //
-      zorba::DynamicContext* lDynamicContext = query->getDynamicContext();
-      try
-      {
-        if ( ! populateDynamicContext(zorbaInstance, lDynamicContext, properties) )
-        {
-          properties.printHelp(std::cout);
-          return 21;
-        }
-      }
-      catch (zorba::XQueryException const& qe)
-      {
-        ErrorPrinter::print(qe, std::cerr, properties.printErrorsAsXml(), lIndent);
-        return 22;
-      }
-      catch (zorba::ZorbaException const& ze)
-      {
-        std::cerr << ze << std::endl;
-        return 23;
-      }
     } // if (doTiming || i == 0)
 
-    // libModule assumes compileOnly even if compileOnly is false
+    //
+    // Run the query, unless compileOnly has been requested.
+    //
     if ( ! properties.compileOnly() && ! properties.libModule() )
     {
-      //
-      // Run the query
-      //
       try
       {
+        // load the execution plan, if requested
+        if (serializePlan) 
+        {
+          planFilep->seekg(0);
+          assert(planFilep->good());
+          
+          // start the plan-load timer
+          if (doTiming)
+            timing.startTimer(TimingInfo::PLAN_LOAD_TIMER, i);
+
+          query = zorbaInstance->createQuery();
+          query->loadExecutionPlan(*planFilep, &theSerializationCallback);
+
+          // stop the plan-load timer
+          if (doTiming)
+            timing.stopTimer(TimingInfo::PLAN_LOAD_TIMER, i);
+        }
+
+        // start the execution timer
         if (doTiming)
-        {
-          // start the execution timer
           timing.startTimer(TimingInfo::EXEC_TIMER, i);
-        }
-
+
+        // Populate the dynamic context
+        zorba::DynamicContext* lDynamicContext = query->getDynamicContext();
+        try
+        {
+          if ( ! populateDynamicContext(zorbaInstance, lDynamicContext, properties) )
+          {
+            properties.printHelp(std::cout);
+            return 21;
+          }
+        }
+        catch (zorba::XQueryException const& qe)
+        {
+          ErrorPrinter::print(qe, std::cerr, properties.printErrorsAsXml(), lIndent);
+          return 22;
+        }
+        catch (zorba::ZorbaException const& ze)
+        {
+          std::cerr << ze << std::endl;
+          return 23;
+        }
+
+        // run the query
         if (properties.noSerializer())
         {
           query->executeSAX();
         }
+        else if (savePlan)
+        {
+          query->saveExecutionPlan(outputStream,
+                                   ZORBA_USE_BINARY_ARCHIVE,
+                                   SAVE_UNUSED_FUNCTIONS);
+        }
         else
         {
           query->execute(outputStream, &lSerOptions);
-          if (properties.trailingNl()) {
-            outputStream << std::endl;
-          }
         }
 
+        if (properties.trailingNl()) 
+          outputStream << std::endl;
+ 
+        query->close();
+
+         // stop the execution timer
         if (doTiming)
-        {
-          // stop the execution timer
           timing.stopTimer(TimingInfo::EXEC_TIMER, i);
-        }
 
-        if (i > 0 || lNumExecutions == 1) {
+        if (i > 0 || lNumExecutions == 1) 
+        {
           timing.elapsedLoadWalltime += query->getDocLoadingTime();
           timing.elapsedLoadCputime += query->getDocLoadingUserTime();
         }
@@ -652,28 +845,37 @@
       }
     }
 
-    // only delete the docs from the store if timing is needed
+    //
+    // Delete all loaded docs from the store, if timing has been requested
+    //
     if (doTiming)
     {
-      //
-      // Delete all loaded docs from the store
-      //
       XmlDataManager* store = zorbaInstance->getXmlDataManager();
 
       timing.startTimer(TimingInfo::UNLOAD_TIMER, i);
+
       DocumentManager* lMgr = store->getDocumentManager();
       ItemSequence_t lSeq = lMgr->availableDocuments();
       Iterator_t lIter = lSeq->getIterator();
       lIter->open();
       Item lURI;
-      while (lIter->next(lURI)) {
+      while (lIter->next(lURI)) 
+      {
         lMgr->remove(lURI.getStringValue());
       }
+
       timing.stopTimer(TimingInfo::UNLOAD_TIMER, i);
+    }
 
+    // stop the total timer
+    if (doTiming)
       timing.stopTimer(TimingInfo::TOTAL_TIMER, i);
-    }
-  }
+
+#ifdef DO_AUDIT
+    audit::Event* event = staticContext->getAuditEvent(); 
+    std::cerr << *event << std::endl;
+#endif
+  } // for each execution
 
   return 0;
 }
@@ -698,27 +900,28 @@
 #endif
 
   // parse the command line and/or the properties file
-  ZorbaCMDProperties lProperties;
-  if (!lProperties.loadProperties(argc, argv))
+  ZorbaCMDProperties properties;
+  if (!properties.loadProperties(argc, argv))
   {
     return 1;
   }
 
-  TimingInfo timing(lProperties.multiple());
+  TimingInfo engineTiming(properties.multiple());
 
-  bool doTiming = lProperties.timing();
+  bool doTiming = properties.timing();
   bool debug = false;
 #ifdef ZORBA_WITH_DEBUGGER
-  debug = (lProperties.debug());
+  debug = (properties.debug());
 #endif
 
   // libModule assumes compileOnly even if compileOnly is false
-  bool compileOnly = (lProperties.compileOnly() || lProperties.libModule() );
+  bool compileOnly = (properties.compileOnly() || properties.libModule() );
 
   // write to file or standard out
-  std::auto_ptr<std::ostream> lFileStream(lProperties.outputFile().size() > 0 ?
-                                           new std::ofstream(lProperties.outputFile().c_str())
-                                          : 0 );
+  std::auto_ptr<std::ostream> 
+  lFileStream(properties.outputFile().size() > 0 ?
+              new std::ofstream(properties.outputFile().c_str()) : 0);
+
   std::ostream* lOutputStream = lFileStream.get();
   if ( lOutputStream == 0 )
   {
@@ -726,43 +929,72 @@
   }
   else if ( !lOutputStream->good() )
   {
-    std::cerr << "could not write to output file {" << lProperties.outputFile()
+    std::cerr << "could not write to output file {" << properties.outputFile()
               << "}" << std::endl;
     return 2;
   }
 
-  if(lProperties.queriesOrFilesBegin() == lProperties.queriesOrFilesEnd())
+  if (properties.queriesOrFilesBegin() == properties.queriesOrFilesEnd())
   {
     std::cerr << "no queries submitted." << std::endl;
-    lProperties.printHelp(std::cout);
+    properties.printHelp(std::cout);
     return 3;
   }
 
+  // Add command line --classpath option in front of config/env CLASSPATH
+  Properties* globaproperties = Properties::instance();
+  std::string cmdJvmClassPath;
+  properties.getJVMClassPath(cmdJvmClassPath);
+  std::string configJvmClassPath;
+  globaproperties->getJVMClassPath(configJvmClassPath);
+  globaproperties->setJVMClassPath(cmdJvmClassPath +
+      filesystem_path::get_path_separator() + configJvmClassPath);
 
   // Start the engine
 
-  timing.startTimer(TimingInfo::INIT_TIMER, 2);
+  engineTiming.startTimer(TimingInfo::INIT_TIMER, 2);
 
   void* store = zorba::StoreManager::getStore();
 
   zorba::Zorba* lZorbaInstance = zorba::Zorba::getInstance(store);
 
+#ifdef DO_AUDIT
+  zorba::audit::Provider* lAuditProvider = lZorbaInstance->getAuditProvider();
+
+  zorba::audit::Configuration* config = lAuditProvider->createConfiguration();
+
+  std::vector<zorba::String> property_names;
+  zorba::audit::Configuration::getPropertyNames(property_names);
+
+  zorba::audit::Configuration::
+  enableProperty(config, property_names, "xquery/compilation/parse-duration");
+
+  zorba::audit::Configuration::
+  enableProperty(config, property_names, "xquery/compilation/translation-duration");
+
+  zorba::audit::Configuration::
+  enableProperty(config, property_names, "xquery/compilation/optimization-duration");
+
+  zorba::audit::Configuration::
+  enableProperty(config, property_names, "xquery/compilation/codegeneration-duration");
+#endif
+
   {
-  timing.stopTimer(TimingInfo::INIT_TIMER, 2);
+  engineTiming.stopTimer(TimingInfo::INIT_TIMER, 2);
 
   // For each query ...
 
   int queryNo;
   ZorbaCMDProperties::QueriesOrFiles_t::const_iterator lIter;
-  for (queryNo = 1, lIter = lProperties.queriesOrFilesBegin();
-       lIter != lProperties.queriesOrFilesEnd();
+  for (queryNo = 1, lIter = properties.queriesOrFilesBegin();
+       lIter != properties.queriesOrFilesEnd();
        ++queryNo, ++lIter)
   {
     //
     // Read the query (either from a file or given as parameter)
     //
     std::string fURI = *lIter;
-    std::string fname = parseFileURI (lProperties.asFiles (), fURI);
+    std::string fname = parseFileURI (properties.asFiles (), fURI);
     zorba::filesystem_path path (fname);
     bool asFile = ! fname.empty ();
     std::auto_ptr<std::istream> qfile;
@@ -770,30 +1002,31 @@
     if (asFile)
     {
       path.resolve_relative ();
-      qfile.reset (new std::ifstream (path.c_str ()));
+      qfile.reset(new std::ifstream (path.c_str ()));
     }
     else
     {
-      qfile.reset (new std::istringstream(fURI));
+      qfile.reset(new std::istringstream(fURI));
     }
 
-    if ( asFile && (!qfile->good() || qfile->eof()) )
+    if (asFile && (!qfile->good() || qfile->eof()))
     {
       std::cerr << "file {" << fname << "} not found or not readable." << std::endl;
-      lProperties.printHelp(std::cout);
+      properties.printHelp(std::cout);
       return 3;
     }
     else if (fURI.empty ())
     {
       std::cerr << "empty query." << std::endl;
-      lProperties.printHelp(std::cout);
+      properties.printHelp(std::cout);
       return 3;
     }
 
     //
     // Print the query if requested
     //
-    if (lProperties.printQuery()) {
+    if (properties.printQuery()) 
+    {
       *lOutputStream << "\nQuery number " << queryNo << " :\n";
       std::copy (std::istreambuf_iterator<char> (*qfile),
                  std::istreambuf_iterator<char> (),
@@ -807,13 +1040,19 @@
     // Create the static context and populate it with info taken from the properties
     //
     zorba::StaticContext_t lStaticContext = lZorbaInstance->createStaticContext();
-    if (! populateStaticContext(lStaticContext, lProperties) )
+
+    if (! populateStaticContext(lZorbaInstance, lStaticContext, properties) )
     {
-      lProperties.printHelp(std::cout);
+      properties.printHelp(std::cout);
       return 3;
     }
 
-    if (!asFile && lProperties.baseUri().size() == 0 )
+#ifdef DO_AUDIT
+    zorba::audit::Event* event = lAuditProvider->createEvent(config);
+    lStaticContext->setAuditEvent(event);
+#endif // DO_AUDIT
+
+    if (!asFile && properties.baseUri().size() == 0 )
     {
       // No user set base URI. Set the cwd to be used as base-uri in order
       // to make the doc function doc("mydoc.xml") work
@@ -836,16 +1075,20 @@
     }
 
     // Parse the query
-    if (lProperties.parseOnly()) {
-      try {
+    if (properties.parseOnly()) 
+    {
+      try 
+      {
         zorba::XQuery_t lQuery = lZorbaInstance->createQuery();
-        if (asFile) {
+        if (asFile)
+        {
           lQuery->setFileName(path.get_path());
         }
 
         lQuery->parse (*qfile);
       }
-      catch (zorba::ZorbaException const& ze) {
+      catch (zorba::ZorbaException const& ze) 
+      {
         std::cerr << ze << std::endl;
         return 6;
       }
@@ -853,52 +1096,71 @@
 
     // Compile and run it if necessary.
     // Print timing information if requested.
-    else if (!debug) {
-      if (compileOnly) {
-        try {
+    else if (!debug) 
+    {
+      if (compileOnly) 
+      {
+        try 
+        {
           zorba::XQuery_t aQuery = lZorbaInstance->createQuery();
-          if (asFile) {
+          if (asFile) 
+          {
             aQuery->setFileName(path.get_path());
           }
+
           aQuery->parse(*qfile);
+
           qfile->clear();
           qfile->seekg(0); // go back to the beginning
-        } catch (zorba::XQueryException const& qe) {
-          ErrorPrinter::print(qe, std::cerr, lProperties.printErrorsAsXml(), lProperties.indent());
+        }
+        catch (zorba::XQueryException const& qe)
+        {
+          ErrorPrinter::print(qe,
+                              std::cerr,
+                              properties.printErrorsAsXml(),
+                              properties.indent());
           return 6;
         }
       }
 
+      TimingInfo queryTiming(properties.multiple());
+
       int status = compileAndExecute(lZorbaInstance,
-                                     lProperties,
+                                     properties,
                                      lStaticContext,
                                      path.get_path(),
                                      *qfile,
                                      *lOutputStream,
-                                     timing);
-      if (status != 0) {
+                                     queryTiming);
+      if (status != 0) 
+      {
         // reset the file handler (in case output option was provided)
         // in order to delete the created output file
         lFileStream.reset();
-        removeOutputFileIfNeeded(lProperties);
+        removeOutputFileIfNeeded(properties);
         return status;
       }
 
-      if (doTiming) {
-        timing.print(std::cout);
+      if (doTiming) 
+      {
+        bool serializePlan = properties.serializePlan();
+        queryTiming.print(std::cout, serializePlan);
       }
     }
 
 #ifdef ZORBA_WITH_DEBUGGER
     // Debug the query. Do not allow "compileOnly" flags and inline queries
-    else if (debug) {
-      if (compileOnly) {
+    else if (debug) 
+    {
+      if (compileOnly) 
+      {
         std::cerr << "cannot debug a query if the compileOnly option is specified"
                   << std::endl;
         return 7;
       }
 
-      if (!asFile) {
+      if (!asFile) 
+      {
         std::cerr << "Cannot debug inline queries." << std::endl;
         return 8;
       }
@@ -908,7 +1170,8 @@
 
       zorba::XQuery_t lQuery;
 
-      try {
+      try 
+      {
         lQuery = lZorbaInstance->createQuery();
         lQuery->setFileName(lFileName);
         lQuery->setDebugMode(true);
@@ -918,30 +1181,33 @@
 
         lQuery->compile(*lXQ.get(), lHints);
         zorba::DynamicContext* lDynamicContext = lQuery->getDynamicContext();
-        if (!populateDynamicContext(lZorbaInstance, lDynamicContext, lProperties)) {
+        if (!populateDynamicContext(lZorbaInstance, lDynamicContext, properties)) {
           return 9;
         }
 
-        std::string lHost = lProperties.debugHost();
+        std::string lHost = properties.debugHost();
         if (lHost == "") {
           lHost = "127.0.0.1";
         }
 
-        if (lProperties.debug()) {
-          Zorba_SerializerOptions lSerOptions =
-              Zorba_SerializerOptions::SerializerOptionsFromStringParams(
-              lProperties.getSerializerParameters());
-          createSerializerOptions(lSerOptions, lProperties);
+        Zorba_SerializerOptions lSerOptions =
+            Zorba_SerializerOptions::SerializerOptionsFromStringParams(
+            properties.getSerializerParameters());
+        createSerializerOptions(lSerOptions, properties);
 
-          if (!lProperties.hasNoLogo() && !lProperties.debug()) {
-            std::cout << "Zorba XQuery Debugger Server\n" << copyright_str << std::endl;
-          }
-          lQuery->debug(*lOutputStream, lSerOptions, lHost, lProperties.getDebugPort());
+        if (!properties.hasNoLogo()) 
+        {
+          std::cout << "Zorba XQuery Debugger Server\n" << copyright_str << std::endl;
         }
+
+        lQuery->debug(*lOutputStream, lSerOptions, lHost, properties.getDebugPort());
       }
       catch (zorba::XQueryException const& qe)
       {
-        ErrorPrinter::print(qe, std::cerr, lProperties.printErrorsAsXml(), lProperties.indent());
+        ErrorPrinter::print(qe,
+                            std::cerr,
+                            properties.printErrorsAsXml(),
+                            properties.indent());
         return 5;
       }
       catch (zorba::ZorbaException const& ze)
@@ -952,25 +1218,33 @@
     } // else if (debug)
 #endif
 
+#ifdef DO_AUDIT
+    lAuditProvider->submitEvent(event);
+#endif
+
   } // for each query
 
   }
 
   if (doTiming)
   {
-    timing.startTimer(TimingInfo::DEINIT_TIMER, 2);
+    engineTiming.startTimer(TimingInfo::DEINIT_TIMER, 2);
   }
 
+#ifdef DO_AUDIT
+  lAuditProvider->destroyConfiguration(config);
+#endif
+
   lZorbaInstance->shutdown();
   zorba::StoreManager::shutdownStore(store);
 
   if (doTiming)
   {
-    timing.stopTimer(TimingInfo::DEINIT_TIMER, 2);
+    engineTiming.stopTimer(TimingInfo::DEINIT_TIMER, 2);
 
     std::cout << std::endl << "Engine Shutdown Time     : "
-              << timing.elapsedDeinitWalltime
-              << " (user: " << timing.elapsedDeinitCputime << ")"
+              << engineTiming.elapsedDeinitWalltime
+              << " (user: " << engineTiming.elapsedDeinitCputime << ")"
               << " milliseconds" << std::endl;
   }
   return 0;

=== modified file 'bin/zorbacmdproperties.cpp'
--- bin/zorbacmdproperties.cpp	2011-07-21 19:21:25 +0000
+++ bin/zorbacmdproperties.cpp	2012-08-19 03:54:29 +0000
@@ -166,11 +166,25 @@
 }
 
 
-void ZorbaCMDProperties::getModulePaths(std::string& aPaths) const
-{
-  aPaths = theModulePath;
-}
-
+void ZorbaCMDProperties::getModulePath(std::string& aPath) const
+{
+  aPath = theModulePath;
+}
+
+void ZorbaCMDProperties::getURIPath(std::string& aPath) const
+{
+  aPath = theUriPath;
+}
+
+void ZorbaCMDProperties::getLibPath(std::string& aPath) const
+{
+  aPath = theLibPath;
+}
+
+void ZorbaCMDProperties::getJVMClassPath(std::string& aPath) const
+{
+  aPath = theClasspath;
+}
 
 std::vector<std::pair<std::string,std::string> > ZorbaCMDProperties::getSerializerParameters() const
 {

=== modified file 'bin/zorbacmdproperties.h'
--- bin/zorbacmdproperties.h	2011-06-29 17:25:50 +0000
+++ bin/zorbacmdproperties.h	2012-08-19 03:54:29 +0000
@@ -84,8 +84,17 @@
   getSerializerParameters() const;
 
   void
-  getModulePaths(std::string&) const;
+  getModulePath(std::string&) const;
   
+  void
+  getURIPath(std::string&) const;
+
+  void
+  getLibPath(std::string&) const;
+
+  void
+  getJVMClassPath(std::string&) const;
+
   bool isDebug(){ return theDebug; }
 
   bool hasNoLogo(){ return theNoLogo; }

=== modified file 'bin/zorbacmdproperties.txt'
--- bin/zorbacmdproperties.txt	2011-07-04 08:31:01 +0000
+++ bin/zorbacmdproperties.txt	2012-08-19 03:54:29 +0000
@@ -28,8 +28,13 @@
 ("debug-port,p", po::value<unsigned int>()->default_value (28028), "The port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028")
 ("no-logo", "Print no logo when starting.")
 ("timeout", po::value<long>()->default_value(-1), "Specify a timeout in seconds. After the specified time, the execution of the query will be aborted.")
-("module-path", po::value<std::string>(), "Module paths added to the built-in resolver, i.e. where module imports are looking for modules.")
+("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.")
+("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.")
+("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.")
+("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations")
 ("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value";).
 ("trailing-nl", "Output a trailing newline after the result of the query.")
 ("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.")
 ("thesaurus", po::value<std::vector<std::string> >(), "Mapping specifying a thesaurus URI to another.")
+("compile-plan,c", "Output the query plan as binary.")
+("execute-plan", "Take a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.")

=== modified file 'bin/zorbacmdproperties_base.h'
--- bin/zorbacmdproperties_base.h	2011-07-04 08:31:01 +0000
+++ bin/zorbacmdproperties_base.h	2012-08-19 03:54:29 +0000
@@ -15,13 +15,6 @@
  */
 /* vim:set et sw=2 ts=2: */
 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .txt FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
 #include <string>
 #include <sstream>
 #include <zorba/config.h>
@@ -30,13 +23,29 @@
 
 #ifndef ZORBACMD_ZORBACMDPROPERTIESBASE
 #define ZORBACMD_ZORBACMDPROPERTIESBASE
-namespace zorbacmd { 
-class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase {
+namespace zorbacmd
+{
+
+class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase
+{
 protected:
-  const char **get_all_options () const {
-    static const char *result [] = { "--timing", "--output-file", "--serialization-parameter", "--serialize-html", "--serialize-text", "--indent", "--print-query", "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration", "--base-uri", "--boundary-space", "--default-collation", "--construction-mode", "--ordering-mode", "--multiple", "--query", "--as-files", "--external-variable", "--context-item", "--optimization-level", "--lib-module", "--parse-only", "--compile-only", "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo", "--timeout", "--module-path", "--option", "--trailing-nl", "--stop-words", "--thesaurus", NULL };
+  const char** get_all_options () const
+  {
+    static const char* result [] = {
+      "--timing", "--output-file", "--serialization-parameter",
+      "--serialize-html", "--serialize-text", "--indent", "--print-query",
+      "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration",
+      "--base-uri", "--boundary-space", "--default-collation",
+      "--construction-mode", "--ordering-mode", "--multiple", "--query",
+      "--as-files", "--external-variable", "--context-item",
+      "--optimization-level", "--lib-module", "--parse-only", "--compile-only",
+      "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo",
+      "--timeout", "--uri-path", "--lib-path", "--module-path", "--classpath",
+      "--option", "--trailing-nl", "--stop-words", "--thesaurus",
+      "--compile-plan", "--execute-plan --serialize-plan", NULL };
     return result;
   }
+
   bool theTiming;
   std::string theOutputFile;
   std::vector<std::string> theSerializationParameter;
@@ -67,13 +76,20 @@
   unsigned int theDebugPort;
   bool theNoLogo;
   long theTimeout;
+  std::string theUriPath;
+  std::string theLibPath;
   std::string theModulePath;
+  std::string theClasspath;
   std::vector<std::string> theOption;
   bool theTrailingNl;
   std::vector<std::string> theStopWords;
   std::vector<std::string> theThesaurus;
+  bool theSerializePlan;
+  bool theSavePlan;
+  bool theLoadPlan;
 
-  void initialize () {
+  void initialize () 
+  {
     theTiming = false;
     theSerializeHtml = false;
     theSerializeText = false;
@@ -95,7 +111,11 @@
     theNoLogo = false;
     theTimeout = -1;
     theTrailingNl = false;
+    theSerializePlan = false;
+    theSavePlan = false;
+    theLoadPlan = false;
   }
+
 public:
   const bool &timing () const { return theTiming; }
   const std::string &outputFile () const { return theOutputFile; }
@@ -127,170 +147,296 @@
   const unsigned int &debugPort () const { return theDebugPort; }
   const bool &noLogo () const { return theNoLogo; }
   const long &timeout () const { return theTimeout; }
+  const std::string &uriPath () const { return theUriPath; }
+  const std::string &libPath () const { return theLibPath; }
   const std::string &modulePath () const { return theModulePath; }
+  const std::string &classpath () const { return theClasspath; }
   const std::vector<std::string> &option () const { return theOption; }
   const bool &trailingNl () const { return theTrailingNl; }
   const std::vector<std::string> &stopWords () const { return theStopWords; }
   const std::vector<std::string> &thesaurus () const { return theThesaurus; }
+  const bool& serializePlan () const { return theSerializePlan; }
+  const bool& loadPlan () const { return theLoadPlan; }
+  const bool& savePlan () const { return theSavePlan; }
 
-  std::string load_argv (int argc, const char **argv) {
+  std::string load_argv (int argc, const char **argv) 
+  {
     if (argv == NULL) return "";
 
     std::string result;
-    for (++argv; *argv != NULL; ++argv) {
+    for (++argv; *argv != NULL; ++argv) 
+    {
       if (strcmp (*argv, "--help") == 0 || strcmp (*argv, "-h") == 0)
         return "!HELP";
+
       else if (strcmp (*argv, "--version") == 0)
         return "!VER";
-      else if (strcmp (*argv, "--timing") == 0 || strncmp (*argv, "-t", 2) == 0) {
+
+      else if (strcmp (*argv, "--timing") == 0 || strncmp (*argv, "-t", 2) == 0) 
+      {
         theTiming = true;
       }
-      else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --output-file option"; break; }        init_val (*argv, theOutputFile, d);
-      }
-      else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; }        init_val (*argv, theSerializationParameter, d);
-      }
-      else if (strcmp (*argv, "--serialize-html") == 0) {
+      else if (strcmp (*argv, "--output-file") == 0 || strncmp (*argv, "-o", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --output-file option"; break; }
+        init_val (*argv, theOutputFile, d);
+      }
+      else if (strcmp (*argv, "--serialization-parameter") == 0 || strncmp (*argv, "-z", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --serialization-parameter option"; break; }
+
+        init_val (*argv, theSerializationParameter, d);
+      }
+      else if (strcmp (*argv, "--serialize-html") == 0) 
+      {
         theSerializeHtml = true;
       }
-      else if (strcmp (*argv, "--serialize-text") == 0) {
+      else if (strcmp (*argv, "--serialize-text") == 0) 
+      {
         theSerializeText = true;
       }
-      else if (strcmp (*argv, "--indent") == 0 || strncmp (*argv, "-i", 2) == 0) {
+      else if (strcmp (*argv, "--indent") == 0 || strncmp (*argv, "-i", 2) == 0) 
+      {
         theIndent = true;
       }
-      else if (strcmp (*argv, "--print-query") == 0) {
+      else if (strcmp (*argv, "--print-query") == 0) 
+      {
         thePrintQuery = true;
       }
-      else if (strcmp (*argv, "--print-errors-as-xml") == 0 || strncmp (*argv, "-x", 2) == 0) {
+      else if (strcmp (*argv, "--print-errors-as-xml") == 0 || strncmp (*argv, "-x", 2) == 0)
+      {
         thePrintErrorsAsXml = true;
       }
-      else if (strcmp (*argv, "--byte-order-mark") == 0) {
+      else if (strcmp (*argv, "--byte-order-mark") == 0) 
+      {
         theByteOrderMark = true;
       }
-      else if (strcmp (*argv, "--omit-xml-declaration") == 0 || strncmp (*argv, "-r", 2) == 0) {
+      else if (strcmp (*argv, "--omit-xml-declaration") == 0 || strncmp (*argv, "-r", 2) == 0) 
+      {
         theOmitXmlDeclaration = true;
       }
-      else if (strcmp (*argv, "--base-uri") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --base-uri option"; break; }        init_val (*argv, theBaseUri, d);
-      }
-      else if (strcmp (*argv, "--boundary-space") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --boundary-space option"; break; }        init_val (*argv, theBoundarySpace, d);
-      }
-      else if (strcmp (*argv, "--default-collation") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --default-collation option"; break; }        init_val (*argv, theDefaultCollation, d);
-      }
-      else if (strcmp (*argv, "--construction-mode") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --construction-mode option"; break; }        init_val (*argv, theConstructionMode, d);
+      else if (strcmp (*argv, "--base-uri") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --base-uri option"; break; }
+        init_val (*argv, theBaseUri, d);
+      }
+      else if (strcmp (*argv, "--boundary-space") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --boundary-space option"; break; }
+        init_val (*argv, theBoundarySpace, d);
+      }
+      else if (strcmp (*argv, "--default-collation") == 0)
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --default-collation option"; break; }
+        init_val (*argv, theDefaultCollation, d);
+      }
+      else if (strcmp (*argv, "--construction-mode") == 0)
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --construction-mode option"; break; }
+
+        init_val (*argv, theConstructionMode, d);
       }
       else if (strcmp (*argv, "--ordering-mode") == 0) {
         int d = 2;
         if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; }        init_val (*argv, theOrderingMode, d);
-      }
-      else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --multiple option"; break; }        init_val (*argv, theMultiple, d);
-      }
-      else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --query option"; break; }        init_val (*argv, theQueriesOrFiles, d);
-      }
-      else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) {
+        if (*argv == NULL) { result = "No value given for --ordering-mode option"; break; }
+
+        init_val (*argv, theOrderingMode, d);
+      }
+      else if (strcmp (*argv, "--multiple") == 0 || strncmp (*argv, "-m", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL)
+        {
+          result = "No value given for --multiple option"; break;
+        }
+        init_val(*argv, theMultiple, d);
+      }
+      else if (strcmp (*argv, "--query") == 0 || strncmp (*argv, "-q", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL)
+        {
+          result = "No value given for --query option"; break;
+        }
+        init_val (*argv, theQueriesOrFiles, d);
+      }
+      else if (strcmp (*argv, "--as-files") == 0 || strncmp (*argv, "-f", 2) == 0) 
+      {
         theAsFiles = true;
       }
-      else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --external-variable option"; break; }        init_val (*argv, theExternalVariable, d);
-      }
-      else if (strcmp (*argv, "--context-item") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --context-item option"; break; }        init_val (*argv, theContextItem, d);
-      }
-      else if (strcmp (*argv, "--optimization-level") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --optimization-level option"; break; }        init_val (*argv, theOptimizationLevel, d);
-      }
-      else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0) {
+      else if (strcmp (*argv, "--external-variable") == 0 || strncmp (*argv, "-e", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) 
+        {
+          result = "No value given for --external-variable option"; break;
+        }
+        init_val(*argv, theExternalVariable, d);
+      }
+      else if (strcmp (*argv, "--context-item") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) 
+        {
+          result = "No value given for --context-item option"; break;
+        }
+        init_val (*argv, theContextItem, d);
+      }
+      else if (strcmp (*argv, "--optimization-level") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL)
+        {
+          result = "No value given for --optimization-level option"; break;
+        }
+        init_val(*argv, theOptimizationLevel, d);
+      }
+      else if (strcmp (*argv, "--lib-module") == 0 || strncmp (*argv, "-l", 2) == 0) 
+      {
         theLibModule = true;
       }
-      else if (strcmp (*argv, "--parse-only") == 0) {
+      else if (strcmp (*argv, "--parse-only") == 0) 
+      {
         theParseOnly = true;
       }
-      else if (strcmp (*argv, "--compile-only") == 0) {
+      else if (strcmp (*argv, "--compile-only") == 0) 
+      {
         theCompileOnly = true;
       }
-      else if (strcmp (*argv, "--no-serializer") == 0) {
+      else if (strcmp (*argv, "--no-serializer") == 0) 
+      {
         theNoSerializer = true;
       }
-      else if (strcmp (*argv, "--debug") == 0 || strncmp (*argv, "-d", 2) == 0) {
+      else if (strcmp (*argv, "--debug") == 0 || strncmp (*argv, "-d", 2) == 0) 
+      {
         theDebug = true;
       }
-      else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --debug-host option"; break; }        init_val (*argv, theDebugHost, d);
-      }
-      else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --debug-port option"; break; }        init_val (*argv, theDebugPort, d);
-      }
-      else if (strcmp (*argv, "--no-logo") == 0) {
+      else if (strcmp (*argv, "--debug-host") == 0 || strncmp (*argv, "-h", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) 
+        {
+          result = "No value given for --debug-host option"; break;
+        }
+        init_val (*argv, theDebugHost, d);
+      }
+      else if (strcmp (*argv, "--debug-port") == 0 || strncmp (*argv, "-p", 2) == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) 
+        {
+          result = "No value given for --debug-port option"; break;
+        }
+        init_val (*argv, theDebugPort, d);
+      }
+      else if (strcmp (*argv, "--no-logo") == 0) 
+      {
         theNoLogo = true;
       }
-      else if (strcmp (*argv, "--timeout") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --timeout option"; break; }        init_val (*argv, theTimeout, d);
-      }
-      else if (strcmp (*argv, "--module-path") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --module-path option"; break; }        init_val (*argv, theModulePath, d);
-      }
-      else if (strcmp (*argv, "--option") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --option option"; break; }        init_val (*argv, theOption, d);
-      }
-      else if (strcmp (*argv, "--trailing-nl") == 0) {
+      else if (strcmp (*argv, "--timeout") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --timeout option"; break; }
+        init_val (*argv, theTimeout, d);
+      }
+      else if (strcmp (*argv, "--uri-path") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --uri-path option"; break; }
+        init_val (*argv, theUriPath, d);
+      }
+      else if (strcmp (*argv, "--lib-path") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --lib-path option"; break; }
+        init_val (*argv, theLibPath, d);
+      }
+      else if (strcmp (*argv, "--module-path") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --module-path option"; break; }
+        init_val (*argv, theModulePath, d);
+      }
+      else if (strcmp (*argv, "--classpath") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --classpath option"; break; }
+
+        init_val (*argv, theClasspath, d);
+      }
+      else if (strcmp (*argv, "--option") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --option option"; break; }
+        init_val (*argv, theOption, d);
+      }
+      else if (strcmp (*argv, "--trailing-nl") == 0) 
+      {
         theTrailingNl = true;
       }
-      else if (strcmp (*argv, "--stop-words") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --stop-words option"; break; }        init_val (*argv, theStopWords, d);
-      }
-      else if (strcmp (*argv, "--thesaurus") == 0) {
-        int d = 2;
-        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
-        if (*argv == NULL) { result = "No value given for --thesaurus option"; break; }        init_val (*argv, theThesaurus, d);
-      }
-      else if (strcmp (*argv, "--") == 0) {
+      else if (strcmp (*argv, "--stop-words") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --stop-words option"; break; }
+        init_val (*argv, theStopWords, d);
+      }
+      else if (strcmp (*argv, "--thesaurus") == 0) 
+      {
+        int d = 2;
+        if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
+        if (*argv == NULL) { result = "No value given for --thesaurus option"; break; }
+        init_val (*argv, theThesaurus, d);
+      }
+      else if (strcmp (*argv, "--serialize-plan") == 0 || strncmp (*argv, "-s", 2) == 0)
+      {
+        theSerializePlan = true;
+      }
+      else if (strcmp (*argv, "--compile-plan") == 0)
+      {
+        theSavePlan = true;
+      }
+      else if (strcmp (*argv, "--execute-plan") == 0)
+      {
+        theLoadPlan = true;
+      }
+      else if (strcmp (*argv, "--") == 0)
+      {
         copy_args (++argv);
         break;
-      } else if ((*argv) [0] == '-') {
+      }
+      else if ((*argv) [0] == '-')
+      {
         result = "unknown command line option "; result += *argv; break; 
-      } else {
+      }
+      else
+      {
         copy_args (argv);
         break;
       }
@@ -299,47 +445,55 @@
     return result;
   }
 
-  const char *get_help_msg () const {
+  const char *get_help_msg () const 
+  {
     return
-"--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"
-"--output-file, -o\nWrite the result to the given file.\n\n"
-"--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"
-"--serialize-html\nSerialize the result as HTML.\n\n"
-"--serialize-text\nSerialize the result as Text.\n\n"
-"--indent, -i\nIndent output.\n\n"
-"--print-query\nPrint the queries.\n\n"
-"--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"
-"--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"
-"--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"
-"--base-uri\nSet the base URI property of the static context.\n\n"
-"--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"
-"--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"
-"--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"
-"--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"
-"--multiple, -m\nExecute the given queries multiple times.\n\n"
-"--query, -q\nQuery test or file URI (file://...)\n\n"
-"--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"
-"--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"
-"--context-item\nSet the context item to the XML document in a given file.\n\n"
-"--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"
-"--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"
-"--parse-only\nStop after parsing the query.\n\n"
-"--compile-only\nOnly compile (don't execute)\n\n"
-"--no-serializer\nDo not serialize (discard) result.\n\n"
-"--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
-"--debug-host, -p\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
-"--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
-"--no-logo\nPrint no logo when starting.\n\n"
-"--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
-"--module-path\nModule paths added to the built-in resolver, i.e. where module imports are looking for modules.\n\n"
-"--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n";
-"--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
-"--stop-words\nMapping specifying a stop-words URI to another.\n\n"
-"--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
-;
+        "--timing, -t\nPrint timing information. In case of multiple queries the timing information is provided per each query. Both wallclock time and user time (which excludes I/O, network delays and other kernel waits) are shown.\n\n"
+        "--output-file, -o\nWrite the result to the given file.\n\n"
+        "--serialization-parameter, -z\nSet serialization parameter in the form of a parameter=value pair (see http://www.w3.org/TR/xslt-xquery-serialization/#serparam, e.g.: -z method=xhtml -z doctype-system=DTD/xhtml1-strict.dtd -z indent=yes).\n\n"
+        "--serialize-html\nSerialize the result as HTML.\n\n"
+        "--serialize-text\nSerialize the result as Text.\n\n"
+        "--indent, -i\nIndent output.\n\n"
+        "--print-query\nPrint the queries.\n\n"
+        "--print-errors-as-xml, -x\nPrint the errors as XML.\n\n"
+        "--byte-order-mark\nSet the byte-order-mark for the serializer.\n\n"
+        "--omit-xml-declaration, -r\nOmit the XML declaration from the result.\n\n"
+        "--base-uri\nSet the base URI property of the static context.\n\n"
+        "--boundary-space\nSet the boundary-space policy ('strip' or 'preserve') in the static context.\n\n"
+        "--default-collation\nAdd the given collation and set the value of the default collation in the static context to the given collation.\n\n"
+        "--construction-mode\nSet the construction mode ('strip' or 'preserve') in the static context.\n\n"
+        "--ordering-mode\nSet the ordering mode ('ordered' or 'unordered') in the static context.\n\n"
+        "--multiple, -m\nExecute the given queries multiple times.\n\n"
+        "--query, -q\nQuery test or file URI (file://...)\n\n"
+        "--as-files, -f\nTreat all -q arguments as file paths instead of URIs or inline queries.\n\n"
+        "--external-variable, -e\nProvide the value for a variable given a file (name=file) or a value (name:=value)\n\n"
+        "--context-item\nSet the context item to the XML document in a given file.\n\n"
+        "--optimization-level\nOptimization level for the query compiler (O0, O1 or O2 - default: O1)\n\n"
+        "--lib-module, -l\nQuery compiler option to treat the query as a library module. If this is set --compile-only option is also set to true.\n\n"
+        "--parse-only\nStop after parsing the query.\n\n"
+        "--compile-only\nOnly compile (don't execute)\n\n"
+        "--no-serializer\nDo not serialize (discard) result.\n\n"
+        "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
+        "--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
+        "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
+        "--no-logo\nPrint no logo when starting.\n\n"
+        "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
+        "--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"
+        "--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"
+        "--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"
+        "--classpath\nJVM classpath to be used by modules using Java implementations\n\n"
+        "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n";
+        "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
+        "--stop-words\nMapping specifying a stop-words URI to another.\n\n"
+        "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
+        "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n"
+        "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n"
+        "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options, and execute the loaded plan.\n\n"
+        ;
   }
 
-  static const ZorbaCMDPropertiesBase *instance () {
+  static const ZorbaCMDPropertiesBase *instance () 
+  {
     static ZorbaCMDPropertiesBase result;
     return &result;
   }

=== modified file 'cmake_modules/FindICU.cmake'
--- cmake_modules/FindICU.cmake	2011-03-06 16:49:30 +0000
+++ cmake_modules/FindICU.cmake	2012-08-19 03:54:29 +0000
@@ -28,6 +28,8 @@
 #                       (note: in addition to ICU_LIBRARIES)
 #  ICU_DATA_LIBRARIES - Libraries to link against for ICU data
 #
+#  ICU_VERSION        - ICU's version number.
+#
 
 # Look for the header file.
 find_path(
@@ -51,6 +53,49 @@
   MESSAGE(STATUS "Could not find ICU library")
 endif (ICU_LIBRARY)
 
+# Discover the version.
+IF (NOT ICU_INCLUDE STREQUAL "")
+  # ICU 3.x has the relevant #defines in uversion.h; 4.x uses uvernum.h.
+  FIND_PATH(ICUVERHPPPATH NAMES unicode/uvernum.h unicode/uversion.h
+    PATHS ${ICU_INCLUDE} NO_DEFAULT_PATH)
+
+  IF ( ${ICUVERHPPPATH} STREQUAL ICUVERHPPPATH-NOTFOUND )
+    SET(ICU_VERSION "0")
+    MESSAGE(STATUS "Found ICU but unable to determine version - assuming version 0")
+  ELSE( ${ICUVERHPPPATH} STREQUAL ICUVERHPPPATH-NOTFOUND )
+    SET (ICUVERHPP)
+    # One of these files has to exist, or else ICUVERHPPPATH wouldn't be set.
+    # If uvernum.h exists, it has the data we want; otherwise, that data is
+    # in uversion.h.
+    FOREACH (header uvernum.h uversion.h)
+      SET (headerfile "${ICUVERHPPPATH}/unicode/${header}")
+      IF (EXISTS "${headerfile}")
+	FILE(READ "${headerfile}" ICUVERHPP)
+	BREAK()
+      ENDIF (EXISTS "${headerfile}")
+    ENDFOREACH (header)
+
+    STRING(REGEX MATCH "\n *#define U_ICU_VERSION_MAJOR_NUM +[0-9]+" ICUVERMAJ 
+      ${ICUVERHPP}) 
+    STRING(REGEX MATCH "\n *#define U_ICU_VERSION_MINOR_NUM +[0-9]+" ICUVERMIN 
+      ${ICUVERHPP})
+    STRING(REGEX
+      MATCH "\n *#define U_ICU_VERSION_PATCHLEVEL_NUM +[0-9]+" ICUVERPATCH 
+      ${ICUVERHPP})
+  
+    STRING(REGEX REPLACE "\n *#define U_ICU_VERSION_MAJOR_NUM +" "" 
+      ICUVERMAJ ${ICUVERMAJ})
+    STRING(REGEX REPLACE "\n *#define U_ICU_VERSION_MINOR_NUM +" "" 
+      ICUVERMIN ${ICUVERMIN})
+    STRING(REGEX REPLACE "\n *#define U_ICU_VERSION_PATCHLEVEL_NUM +" "" 
+      ICUVERPATCH ${ICUVERPATCH})
+  
+    SET(ICU_VERSION ${ICUVERMAJ}.${ICUVERMIN}.${ICUVERPATCH})
+    MESSAGE(STATUS "ICU Version: ${ICU_VERSION}")
+  
+  ENDIF ( ${ICUVERHPPPATH} STREQUAL ICUVERHPPPATH-NOTFOUND )
+ENDIF (NOT ICU_INCLUDE STREQUAL "")
+
 
 # Copy the results to the output variables.
 if(ICU_INCLUDE AND ICU_LIBRARY)
@@ -107,4 +152,5 @@
   set(ICU_I18N_LIBRARIES)
   set(ICU_DATA_LIBRARIES)
   set(ICU_INCLUDE_DIRS)
+  set(ICU_VERSION 0)
 endif(ICU_INCLUDE AND ICU_LIBRARY)

=== modified file 'cmake_modules/FindJNI.cmake'
--- cmake_modules/FindJNI.cmake	2011-08-02 15:06:17 +0000
+++ cmake_modules/FindJNI.cmake	2012-08-19 03:54:29 +0000
@@ -101,6 +101,12 @@
   ${_JAVA_HOME}/jre/lib
   ${_JAVA_HOME}/lib
   ${_JAVA_HOME}
+  /usr/lib/jvm/java-6-openjdk/jre/lib
+  /usr/lib/jvm/java-6-openjdk-i386/jre/lib
+  /usr/lib/jvm/java-6-openjdk-amd64/jre/lib
+  /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
+  /usr/lib/jvm/java-6-openjdk-i386/jre/lib/{libarch}
+  /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/{libarch}
   /usr/lib
   /usr/local/lib
   /usr/lib/jvm/java/lib
@@ -113,7 +119,6 @@
   /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
   /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
   /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch}       # can this one be removed according to #8821 ? Alex
-  /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
   /usr/lib/jvm/java-openjdk/jre/lib/{libarch}
   # Debian specific paths for default JVM
   /usr/lib/jvm/default-java/jre/lib/{libarch}
@@ -137,6 +142,9 @@
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
   ${_JAVA_HOME}/include
+  /usr/lib/jvm/java-6-openjdk/include
+  /usr/lib/jvm/java-6-openjdk-amd64/include
+  /usr/lib/jvm/java-6-openjdk-i386/include
   /usr/include 
   /usr/local/include
   /usr/lib/java/include

=== added file 'cmake_modules/FindLibedit.cmake'
--- cmake_modules/FindLibedit.cmake	1970-01-01 00:00:00 +0000
+++ cmake_modules/FindLibedit.cmake	2012-08-19 03:54:29 +0000
@@ -0,0 +1,46 @@
+# Copyright 2011 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.
+#
+# - Try to find the libedit library
+#
+# Once done this will define
+#
+#  LIBEDIT_FOUND        - True if libedit library is found
+#  LIBEDIT_INCLUDE_DIRS - Directory to include to get libedit headers
+#  LIBEDIT_LIBRARIES    - Libraries to link against for the libedit library
+#
+
+FIND_PATH (
+  LIBEDIT_INCLUDE
+  editline/readline.h
+  PATHS ${LIBEDIT_INCLUDE_DIR} /usr/include /usr/local/include
+)
+MESSAGE(STATUS ${LIBEDIT_INCLUDE})
+
+FIND_LIBRARY (
+  LIBEDIT_LIBRARY
+  NAMES edit
+  PATHS ${LIBEDIT_LIBRARY_DIR} /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
+) 
+MESSAGE(STATUS ${LIBEDIT_LIBRARY})
+
+SET (LIBEDIT_INCLUDE_DIRS ${LIBEDIT_INCLUDE})
+SET (LIBEDIT_LIBRARIES ${LIBEDIT_LIBRARY})
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (
+  Libedit
+  DEFAULT_MSG
+  LIBEDIT_INCLUDE LIBEDIT_LIBRARY
+)
+

=== modified file 'cmake_modules/FindPHP5.cmake'
--- cmake_modules/FindPHP5.cmake	2011-08-19 00:03:31 +0000
+++ cmake_modules/FindPHP5.cmake	2012-08-19 03:54:29 +0000
@@ -97,6 +97,14 @@
     _zend_rsrc_list_get_rsrc_type
     _zend_wrong_param_count
     _zval_used_for_init
+    _zval_is_true
+    _zend_lookup_class
+    __object_init
+    __zend_hash_add_or_update
+    _php_strtolower
+    _executor_globals
+    _call_user_function
+    _php_sprintf
     )
     SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")

=== added file 'cmake_modules/Windows/FindCSharp.cmake'
--- cmake_modules/Windows/FindCSharp.cmake	1970-01-01 00:00:00 +0000
+++ cmake_modules/Windows/FindCSharp.cmake	2012-08-19 03:54:29 +0000
@@ -0,0 +1,90 @@
+# Copyright 2010 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.
+
+FILE(TO_CMAKE_PATH "$ENV{WINDIR}" windir)
+SET(framework_version "$ENV{FrameworkVersion}")
+
+SET(csc_search_paths
+  "${windir}/Microsoft.NET/Framework/v2.0.50727"
+  "${windir}/Microsoft.NET/Framework/v3.5"
+  "${windir}/Microsoft.NET/Framework/v3.0"
+  )
+
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 9 2008")
+  SET(csc_search_paths
+    "${windir}/Microsoft.NET/Framework/v3.5"
+    "${windir}/Microsoft.NET/Framework/v3.0"
+    "${windir}/Microsoft.NET/Framework/v2.0.50727"
+    )
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 9 2008")
+
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 10")
+  SET(csc_search_paths
+    "${windir}/Microsoft.NET/Framework/v4.0.30128"
+    "${windir}/Microsoft.NET/Framework/v3.5"
+    "${windir}/Microsoft.NET/Framework/v3.0"
+    "${windir}/Microsoft.NET/Framework/v2.0.50727"
+    )
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 10")
+
+FIND_PROGRAM(csc_EXECUTABLE "csc"
+  ${csc_search_paths}
+  "${windir}/Microsoft.NET/Framework/${framework_version}"
+  "${windir}/Microsoft.NET/Framework/v1.1.4322"
+  "${windir}/Microsoft.NET/Framework/v1.0.3705"
+  NO_DEFAULT_PATH
+  )
+
+IF(NOT csc_EXECUTABLE)
+  FIND_PROGRAM(csc_EXECUTABLE NAMES "csc" "gmcs")
+ENDIF(NOT csc_EXECUTABLE)
+
+FIND_PROGRAM(mono_EXECUTABLE "mono")
+
+GET_FILENAME_COMPONENT(csc_DIR "${csc_EXECUTABLE}" PATH)
+
+SET(CSC_ACCEPTS_PLATFORM_FLAG 0)
+SET(CSC_COMPILES_PARTIAL_CLASSES 0)
+
+IF(csc_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND "${csc_EXECUTABLE}" "/?" OUTPUT_VARIABLE CSC_HELP)
+
+  IF("${CSC_HELP}" MATCHES "/platform:<string>")
+    SET(CSC_ACCEPTS_PLATFORM_FLAG 1)
+    SET(CSC_COMPILES_PARTIAL_CLASSES 1)
+  ENDIF("${CSC_HELP}" MATCHES "/platform:<string>")
+ENDIF(csc_EXECUTABLE)
+
+IF(NOT DEFINED CSC_PLATFORM_FLAG)
+  SET(CSC_PLATFORM_FLAG "")
+  IF(CSC_ACCEPTS_PLATFORM_FLAG)
+    SET(CSC_PLATFORM_FLAG "/platform:x86")
+    IF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
+      SET(CSC_PLATFORM_FLAG "/platform:x64")
+    ENDIF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
+  ENDIF(CSC_ACCEPTS_PLATFORM_FLAG)
+ENDIF(NOT DEFINED CSC_PLATFORM_FLAG)
+
+IF(NOT DEFINED CSC_DEBUG_FLAG)
+  SET(CSC_DEBUG_FLAG "")
+  IF("${CMAKE_BUILD_TYPE}" MATCHES "Debug|RelWithDebInfo")
+    SET(CSC_DEBUG_FLAG "/debug")
+  ENDIF("${CMAKE_BUILD_TYPE}" MATCHES "Debug|RelWithDebInfo")
+  IF("${BUILDNAME}" MATCHES "Debug|RelWithDebInfo")
+    SET(CSC_DEBUG_FLAG "/debug")
+  ENDIF("${BUILDNAME}" MATCHES "Debug|RelWithDebInfo")
+  IF("${CMAKE_BINARY_DIR}" MATCHES "Debug|RelWithDebInfo")
+    SET(CSC_DEBUG_FLAG "/debug")
+  ENDIF("${CMAKE_BINARY_DIR}" MATCHES "Debug|RelWithDebInfo")
+ENDIF(NOT DEFINED CSC_DEBUG_FLAG)

=== modified file 'cmake_modules/Windows/FindCURL.cmake'
--- cmake_modules/Windows/FindCURL.cmake	2011-10-08 16:34:42 +0000
+++ cmake_modules/Windows/FindCURL.cmake	2012-08-19 03:54:29 +0000
@@ -40,6 +40,7 @@
     FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "libeay32")
     FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "openldap")
     FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "ssleay32")
+    FIND_PACKAGE_DLL_WIN32 (${FOUND_LOCATION} "libsasl")
 
   ELSE (EXISTS "${FOUND_LOCATION}/curl.exe")
 

=== modified file 'cmake_modules/Windows/ProxyFindModule.cmake'
--- cmake_modules/Windows/ProxyFindModule.cmake	2011-10-08 16:34:42 +0000
+++ cmake_modules/Windows/ProxyFindModule.cmake	2012-08-19 03:54:29 +0000
@@ -32,6 +32,15 @@
 ENDMACRO (PRINT_FIND_END_TITLE)
 
 
+MACRO (PRINT_FIND_END_TITLE_SYSTEM MODULE_NAME FOUND)
+  IF (${FOUND})
+    MESSAGE (STATUS "************* DONE (found) *************")
+  ELSE (${FOUND})
+    MESSAGE (STATUS "*********** DONE (not found) ***********")
+  ENDIF (${FOUND})
+ENDMACRO (PRINT_FIND_END_TITLE_SYSTEM)
+
+
 MACRO (INSTALL_DLL DLL_PATH)
   IF (${PROJECT_NAME} STREQUAL "zorba")
     # for zorba core requirements, install this DLL
@@ -213,6 +222,34 @@
 ENDMACRO (FIND_PACKAGE_WIN32)
 
 
+# This macro will just perform a normal library search without trying to guess
+# locations. This should be used for searching libraries that can be found on
+# Windows using other means like registry entries (ImageMagick) or special
+# environment variables (Java or JNI)
+MACRO (FIND_PACKAGE_WIN32_NO_PROXY MODULE_NAME FOUND_VAR)
+
+  PRINT_FIND_TITLE (${MODULE_NAME})
+
+  # remove the Windows module path (both from Zorba or the external modules)
+  # to avoid an infinite recursion
+  FOREACH (PATH ${CMAKE_MODULE_PATH})
+    IF ("${PATH}" MATCHES ".*/cmake_modules/Windows")
+      LIST (REMOVE_ITEM CMAKE_MODULE_PATH "${PATH}")
+    ENDIF ("${PATH}" MATCHES ".*/cmake_modules/Windows")
+  ENDFOREACH (PATH)
+
+  FIND_PACKAGE (${MODULE_NAME})
+
+  # restore the module path
+  SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/Windows ${CMAKE_MODULE_PATH})
+  # restore the prefix path
+  SET (CMAKE_PREFIX_PATH ${OLD_CMAKE_PREFIX_PATH})
+
+  PRINT_FIND_END_TITLE_SYSTEM (${MODULE_NAME} ${FOUND_VAR})
+
+ENDMACRO (FIND_PACKAGE_WIN32_NO_PROXY)
+
+
 # This macro will search for a DLL in the given library location using extra
 # arguments as alternative names of the DLL. The first DLL found with that name
 # is considered. This is useful for some libraries that come with different DLL

=== modified file 'cmake_modules/ZorbaGenerateExe.cmake'
--- cmake_modules/ZorbaGenerateExe.cmake	2011-07-31 23:28:05 +0000
+++ cmake_modules/ZorbaGenerateExe.cmake	2012-08-19 03:54:29 +0000
@@ -68,8 +68,8 @@
     INSTALL (TARGETS ${EXE_NAME}${SUFFIX} DESTINATION ${INSTALL_DESTINATION})
   ENDIF (NOT ${INSTALL_DESTINATION} STREQUAL "")
 
-  # generate list of bat scripts to set the PATH variable for the executables
   IF (WIN32)
+    # generate list of bat scripts to set the PATH variable for the executables
     IF (NOT ${NEW_NAME} STREQUAL "")
       SET (ZORBA_EXE_NAME "${NEW_NAME}${SUFFIX}")
     ELSE (NOT ${NEW_NAME} STREQUAL "")
@@ -79,20 +79,18 @@
     SET (ZORBA_EXE_SCRIPT_LIST "${ZORBA_EXE_SCRIPT_LIST}${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_EXE_NAME}.bat;"
       CACHE STRING "List of Windows batch scripts to be generated, one for each executable" FORCE
     )
+
+
+    # generate list of Visual Studio project files to set the PATH variable
+    IF (MSVC_IDE)
+      SET (SYSTEM_NAME $ENV{USERDOMAIN})
+      SET (USER_NAME $ENV{USERNAME})
+      SET (ZORBA_VC_PROJECT_FILE_LIST "${ZORBA_VC_PROJECT_FILE_LIST}${EXE_NAME}.vcproj.${SYSTEM_NAME}.${USER_NAME}.user"
+        CACHE STRING "List of Visual Studio project files to be generated, one for each executable" FORCE
+      )
+    ENDIF (MSVC_IDE)
   ENDIF (WIN32)
   
-  # generating initial property file for each executable in visual studio
-  # is done to set the PATH variable correctly
-  IF (MSVC_IDE)
-    SET (SYSTEM_NAME $ENV{USERDOMAIN})
-    SET (USER_NAME $ENV{USERNAME})
-    SET (ZORBA_VC_PROJECT_CONFIG_FILE "${EXE_NAME}${SUFFIX}.vcproj.${SYSTEM_NAME}.${USER_NAME}.user")
-    # Do not overwrite old property files. The user might have adapted something.
-    IF (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_VC_PROJECT_CONFIG_FILE})
-      CONFIGURE_FILE (${CMAKE_SOURCE_DIR}/cmake_modules/VCProject.vcproj.in ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_VC_PROJECT_CONFIG_FILE})
-    ENDIF (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_VC_PROJECT_CONFIG_FILE})
-  ENDIF (MSVC_IDE)
-
   IF (ZORBA_BUILD_STATIC_LIBRARY)
     ADD_EXECUTABLE ("${EXE_NAME}${SUFFIX}_static" ${SRCS})
     SET_TARGET_PROPERTIES ("${EXE_NAME}${SUFFIX}_static" PROPERTIES COMPILE_DEFINITIONS BUILDING_ZORBA_STATIC)
@@ -112,12 +110,12 @@
 ENDMACRO (ZORBA_GENERATE_EXE)
 
 
-# This macro will read the ZORBA_EXE_SCRIPT_LIST environments variable and will
-# generate them near each corresponding executable.
+# This macro will read the ZORBA_EXE_SCRIPT_LIST and ZORBA_VC_PROJECT_CONFIG_FILE 
+# environment variables and will generate them near each corresponding executable.
 # This macro must be invoked AFTER all the required libraries have been searched
 # for (both Zorba and external modules) in order to set a correct path in the
 # scripts.
-MACRO (ZORBA_GENERATE_EXE_SCRIPTS_WIN32)
+MACRO (ZORBA_GENERATE_EXE_HELPERS_WIN32)
 
   IF (NOT WIN32)
     MESSAGE (FATAL_ERROR "This macro is intended only for Windows platforms.")
@@ -141,4 +139,12 @@
 
   ENDFOREACH (SCRIPT)
 
-ENDMACRO (ZORBA_GENERATE_EXE_SCRIPTS_WIN32)
+  FOREACH (VCFILE ${ZORBA_VC_PROJECT_FILE_LIST})
+    # Do not overwrite old property files. The user might have adapted something.
+    IF (NOT EXISTS ${VCFILE})
+      CONFIGURE_FILE (${CMAKE_SOURCE_DIR}/cmake_modules/VCProject.vcproj.in ${VCFILE})
+    ENDIF (NOT EXISTS ${VCFILE})
+  ENDFOREACH(VCFILE)
+
+
+ENDMACRO (ZORBA_GENERATE_EXE_HELPERS_WIN32)

=== modified file 'cmake_modules/ZorbaModule.cmake'
--- cmake_modules/ZorbaModule.cmake	2011-10-09 01:15:10 +0000
+++ cmake_modules/ZorbaModule.cmake	2012-08-19 03:54:29 +0000
@@ -66,7 +66,8 @@
 #
 # Parameters:
 #   URI - URI to mangle
-#   EXT - extension to ensure URI ends with
+#   EXT - extension to ensure URI ends with (may be empty; if set, must
+#         include leading "."
 #   DIR_VAR - variable to set with the directory part of the mangled path
 #   FILE_VAR - variable to set with the file part of the mangled path
 MACRO (MANGLE_URI URI EXT DIR_VAR FILE_VAR)
@@ -89,13 +90,14 @@
 
   # Convert final component into proper filename
   IF (NOT final_comp)
-    SET (${FILE_VAR} "index.${EXT}")
+    SET (${FILE_VAR} "index${EXT}")
   ELSE (NOT final_comp)
-    IF ("${final_comp}" MATCHES "\\.${EXT}$")
+    # \\ necessary to escape the leading . in EXT
+    IF ("${final_comp}" MATCHES "\\${EXT}$")
       SET (${FILE_VAR} "${final_comp}")
-    ELSE ("${final_comp}" MATCHES "\\.${EXT}$")
-      SET (${FILE_VAR} "${final_comp}.${EXT}")
-    ENDIF ("${final_comp}" MATCHES "\\.${EXT}$")
+    ELSE ("${final_comp}" MATCHES "\\${EXT}$")
+      SET (${FILE_VAR} "${final_comp}${EXT}")
+    ENDIF ("${final_comp}" MATCHES "\\${EXT}$")
   ENDIF (NOT final_comp)
 
   # Stick the reversed authority back on the front of the path: done!
@@ -138,12 +140,7 @@
   ENDIF (NOT IS_ABSOLUTE "${MODULE_FILE}")
   GET_FILENAME_COMPONENT (module_name "${MODULE_FILE}" NAME)
 
-
-  MANGLE_URI (${MODULE_URI} "xq" module_path module_filename)
-
-  # Compute a CMake-symbol-safe version of the target URI, for storing
-  # things in CMake properties.
-  STRING (REGEX REPLACE "[/ ]" "_" uri_sym "${module_path}/${module_filename}")
+  MANGLE_URI (${MODULE_URI} ".xq" module_path module_filename)
 
   # Determine which module this is, numerically. This number will be
   # used to generate unique names, for instance for the target name
@@ -159,41 +156,52 @@
   MATH (EXPR num_zorba_modules "${num_zorba_modules} + 1")
   SET_PROPERTY (GLOBAL PROPERTY ZORBA_MODULE_COUNT ${num_zorba_modules})
 
-  # Compute the version numbers, if any provided.
-  IF (MODULE_VERSION)
-    STRING (REPLACE "." ";" version "${MODULE_VERSION}")
-    LIST (LENGTH version version_len)
-    IF (NOT (version_len EQUAL 2) OR (version_len EQUAL 3))
-      MESSAGE (FATAL_ERROR
-        "Version ${MODULE_VERSION} not of form 'major.minor[.patch]'")
-    ENDIF (NOT (version_len EQUAL 2) OR (version_len EQUAL 3))
-    LIST (GET version 0 major_ver)
-    LIST (GET version 1 minor_ver)
-    IF (version_len EQUAL 3)
-      LIST (GET version 2 patch_ver)
-      MATH (EXPR version_int
-        "${major_ver} * 100000000 + ${minor_ver} * 100000 + ${patch_ver}")
-    ELSE (version_len EQUAL 3)
-      SET (patch_ver)
-      MATH (EXPR version_int "${major_ver} * 100000000 + ${minor_ver} * 100000")
-    ENDIF (version_len EQUAL 3)
-
-    # We maintain a global CMake property named after the target URI
-    # which remembers all versions of this URI which have been
-    # declared. If a *lower* version has already been declared, the
-    # output file rules will be messed up, so die.
-    GET_PROPERTY (target_versions GLOBAL PROPERTY "${uri_sym}-versions")
-    FOREACH (known_ver ${target_versions})
-      IF (known_ver LESS version_int)
-        MESSAGE (FATAL_ERROR
-          "The module ${MODULE_URI} has already been declared with a "
-          "lower version number than ${MODULE_VERSION}. "
-          "Please call DECLARE_ZORBA_MODULE() for higher versions of the same "
-          "module first.")
-      ENDIF (known_ver LESS version_int)
-    ENDFOREACH (known_ver)
-    SET_PROPERTY (GLOBAL APPEND PROPERTY "${uri_sym}-versions" ${version_int})
-  ENDIF (MODULE_VERSION)
+  # If no version specified, it is effectively treated as 0.0.0.
+  IF (NOT MODULE_VERSION)
+    SET (MODULE_VERSION "0.0.0")
+  ENDIF (NOT MODULE_VERSION)
+
+  # Compute a unique integer, version_int, based on the version
+  # number, so we can more easily compare with other versions later.
+  STRING (REPLACE "." ";" version "${MODULE_VERSION}")
+  LIST (LENGTH version version_len)
+  IF (NOT ( (version_len EQUAL 2) OR (version_len EQUAL 3) ) )
+    MESSAGE (FATAL_ERROR
+      "Version ${version_len} ${MODULE_VERSION} not of form 'major.minor[.patch]'")
+  ENDIF (NOT ( (version_len EQUAL 2) OR (version_len EQUAL 3) ) )
+  LIST (GET version 0 major_ver)
+  LIST (GET version 1 minor_ver)
+  IF (version_len EQUAL 3)
+    LIST (GET version 2 patch_ver)
+    MATH (EXPR version_int
+      "${major_ver} * 100000000 + ${minor_ver} * 100000 + ${patch_ver}")
+  ELSE (version_len EQUAL 3)
+    SET (patch_ver)
+    MATH (EXPR version_int "${major_ver} * 100000000 + ${minor_ver} * 100000")
+  ENDIF (version_len EQUAL 3)
+
+  # We maintain a global CMake property named after the target URI
+  # which remembers all versions of this URI which have been
+  # declared. If a *lower* version has already been declared, the
+  # output file rules will be messed up, so die. If the *same* version
+  # has already been declare, XQdoc will be messed up, so die.
+  STRING (REGEX REPLACE "[/:#% ]" "_" uri_sym "${MODULE_URI}")
+  GET_PROPERTY (target_versions GLOBAL PROPERTY "${uri_sym}-versions")
+  FOREACH (known_ver ${target_versions})
+    IF (known_ver LESS version_int)
+      MESSAGE (FATAL_ERROR
+        "The module ${MODULE_URI} has already been declared with a "
+        "lower version number than ${MODULE_VERSION}. "
+        "Please call DECLARE_ZORBA_MODULE() for higher versions of the same "
+        "module first.")
+    ElSEIF (known_ver EQUAL version_int)
+      MESSAGE (FATAL_ERROR
+        "The module ${MODULE_URI} has already been declared with the "
+        "version number ${MODULE_VERSION}. You cannot declare the same "
+        "module twice.")
+    ENDIF (known_ver LESS version_int)
+  ENDFOREACH (known_ver)
+  SET_PROPERTY (GLOBAL APPEND PROPERTY "${uri_sym}-versions" ${version_int})
 
   # Add to module manifest (except test modules).
   IF (NOT MODULE_TEST_ONLY)
@@ -250,6 +258,19 @@
     SET(module_lib_target "modlib${num_zorba_modules}_${module_name}")
     ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES})
     GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE)
+    IF (MODULE_VERSION)
+      # If there's a version, insert it into the module library name
+      SET (module_filewe "${module_filewe}_${MODULE_VERSION}")
+    ENDIF (MODULE_VERSION)
+
+    # Compute the output path for the library. Note: This is copied
+    # from ADD_COPY_RULE(); probably should refactor this logic.
+    IF (${MODULE_TEST_ONLY} EQUAL 1)
+      SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH")
+    ELSE (${MODULE_TEST_ONLY} EQUAL 1)
+      SET (_output_basedir "${CMAKE_BINARY_DIR}/LIB_PATH")
+    ENDIF (${MODULE_TEST_ONLY} EQUAL 1)
+
     # It seems like it would be nice to set the VERSION and/or
     # SOVERSION target properties here. However: On Windows, it
     # doesn't seem to do anything (the .rc file configured above
@@ -260,24 +281,56 @@
     # target property isn't desirable.
     # FOLDER is to group IDE projects into folders.
     SET_TARGET_PROPERTIES (${module_lib_target} PROPERTIES
-      OUTPUT_NAME "${module_filewe}_${MODULE_VERSION}${SUFFIX}"
-      ${target_type}_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.src"
+      OUTPUT_NAME "${module_filewe}${SUFFIX}"
+      ${target_type}_OUTPUT_DIRECTORY "${_output_basedir}/${module_path}"
       FOLDER "Modules"
-    )
-    TARGET_LINK_LIBRARIES(${module_lib_target}
-      zorba_${ZORBA_STORE_NAME} ${MODULE_LINK_LIBRARIES})
-
+      )
+    TARGET_LINK_LIBRARIES(${module_lib_target} zorba_${ZORBA_STORE_NAME})
+ 
+    # Ridiculous hack: CMake doesn't seem to (reliably) set up
+    # dependencies if you specify a library to TARGET_LINK_LIBRARIES()
+    # which is the output of some other ADD_LIBRARY(). We can't solve
+    # this problem in the general case. We can work around it,
+    # however, in the specific case where the target library was
+    # generated by an earlier call to DECLARE_ZORBA_MODULE() - by
+    # remembering that output library's path and its corresponding
+    # target in a global property.
+    FOREACH (_lib ${MODULE_LINK_LIBRARIES})
+      GET_PROPERTY (_targetname GLOBAL PROPERTY "${_lib}_TARGET")
+      IF ("${_targetname}" STREQUAL "")
+	TARGET_LINK_LIBRARIES(${module_lib_target} "${_lib}")
+      ELSE ("${_targetname}" STREQUAL "")
+	TARGET_LINK_LIBRARIES(${module_lib_target} "${_targetname}")
+      ENDIF ("${_targetname}" STREQUAL "")
+    ENDFOREACH (_lib)
+
+    # Remember this library for the auto-generated module Config.cmake
+    # file. Also remember the target name for the hack mentioned
+    # above.  QQQ and what about the installed version?
+    GET_TARGET_PROPERTY (_lib_location "${module_lib_target}" LOCATION)
+    SET_PROPERTY (GLOBAL APPEND PROPERTY "${PROJECT_NAME}_LIBRARIES"
+      "${_lib_location}")
+    SET_PROPERTY (GLOBAL PROPERTY "${_lib_location}_TARGET"
+      "${module_lib_target}")
+
+    # If this is a core module, remember the target that builds the
+    # library so zorbacmd can depend on it.
+    IF (${PROJECT_NAME} STREQUAL "zorba")
+      SET_PROPERTY (GLOBAL APPEND PROPERTY ZORBA_CORE_MODULE_LIB_TARGETS
+	"${module_lib_target}")
+    ENDIF (${PROJECT_NAME} STREQUAL "zorba")
+      
     # Install the library, if it's not a TEST_ONLY module
     IF (NOT MODULE_TEST_ONLY)
       IF(NOT ${PROJECT_NAME} STREQUAL "zorba")
         STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})
         INSTALL(TARGETS ${module_lib_target}
-          ${target_type} DESTINATION ${ZORBA_MODULES_INSTALL_DIR}/${module_path}
+          ${target_type} DESTINATION ${ZORBA_NONCORE_LIB_DIR}/${module_path}
           COMPONENT ${component_name})
       
       ELSE(NOT ${PROJECT_NAME} STREQUAL "zorba")
         INSTALL(TARGETS ${module_lib_target}
-          ${target_type} DESTINATION ${ZORBA_MODULES_INSTALL_DIR}/${module_path})
+          ${target_type} DESTINATION ${ZORBA_CORE_LIB_DIR}/${module_path})
       ENDIF(NOT ${PROJECT_NAME} STREQUAL "zorba")
     ENDIF (NOT MODULE_TEST_ONLY)
       
@@ -296,18 +349,10 @@
     ENDIF (patch_ver)
   ENDIF (MODULE_VERSION)
   FOREACH (version_infix "" ${version_infixes})
-    ADD_COPY_RULE ("${SOURCE_FILE}" "${module_path}/${module_filename}"
-      "${version_infix}" "" "${MODULE_TEST_ONLY}")
+    ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${module_path}/${module_filename}"
+      "${version_infix}" "" 1 "${MODULE_TEST_ONLY}")
   ENDFOREACH (version_infix)
 
-  # Also copy the dynamic library from the location it was built.
-  IF (module_lib_target)
-    GET_TARGET_PROPERTY (lib_location "${module_lib_target}" LOCATION)
-    GET_FILENAME_COMPONENT (lib_filename "${lib_location}" NAME)
-    ADD_COPY_RULE ("${lib_location}" "${module_path}/${lib_filename}"
-      "" "${module_lib_target}" "${MODULE_TEST_ONLY}")
-  ENDIF (module_lib_target)
-
   # Last but not least, whip up a test case that ensures the module
   # can at least be compiled. Don't bother for test-only modules
   # (presumably they're there to be tested!).
@@ -328,6 +373,16 @@
 
 ENDMACRO (DECLARE_ZORBA_MODULE)
 
+# Macro to see whether a given module has been declared, by URI.
+# For now this only returns a true or false value; version introspection
+# is not supported.
+MACRO (IS_ZORBA_MODULE_DECLARED IS_SET_VAR MODULE_URI)
+  # Just check for the existence of the "URI-versions" global property,
+  # as set by DECLARE_ZORBA_MODULE()
+  STRING (REGEX REPLACE "[/:#% ]" "_" uri_sym "${MODULE_URI}")
+  GET_PROPERTY (${IS_SET_VAR} GLOBAL PROPERTY "${uri_sym}-versions" SET)
+ENDMACRO (IS_ZORBA_MODULE_DECLARED)
+
 # Macro which declares a schema. This sets up the installation of the
 # schema into the URI_PATH folder so it will be found at runtime.
 #
@@ -350,34 +405,119 @@
     SET (SOURCE_FILE "${SCHEMA_FILE}")
   ENDIF (NOT IS_ABSOLUTE "${SCHEMA_FILE}")
   GET_FILENAME_COMPONENT (schema_name "${SCHEMA_FILE}" NAME)
-  MANGLE_URI (${SCHEMA_URI} "xsd" schema_path schema_filename)
+  MANGLE_URI (${SCHEMA_URI} ".xsd" schema_path schema_filename)
 
   # Add to schema manifest (except test schema).
   IF (NOT SCHEMA_TEST_ONLY)
     ADD_ZORBA_MANIFEST_ENTRY("schema" ${SCHEMA_URI} "")
   ENDIF (NOT SCHEMA_TEST_ONLY)
 
-  ADD_COPY_RULE ("${SOURCE_FILE}" "${schema_path}/${schema_filename}"
-    "" "" "${SCHEMA_TEST_ONLY}")
+  ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${schema_path}/${schema_filename}"
+    "" "" 1 "${SCHEMA_TEST_ONLY}")
 
 ENDMACRO (DECLARE_ZORBA_SCHEMA)
 
+# Macro which declares a file to be loaded by URI. This sets up the
+# installation of the file into the URI_PATH folder so it will be
+# found at runtime.
+#
+# Args: URI - the URI of the file
+#       FILE - path to file (if not absolute, will be resolved
+#              relative to CMAKE_CURRENT_SOURCE_DIR)
+#       TEST_ONLY - (optional) File is for testcases only and should not
+#              be installed
+MACRO (DECLARE_ZORBA_URI_FILE)
+  # QQQ Refactor - this macro is basically identical to DECLARE_ZORBA_SCHEMA
+  PARSE_ARGUMENTS(URI_FILE "" "URI;FILE" "TEST_ONLY" ${ARGN})
+  IF (NOT URI_FILE_FILE)
+    MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_URI_FILE()")
+  ENDIF (NOT URI_FILE_FILE)
+  IF (NOT URI_FILE_URI)
+    MESSAGE (FATAL_ERROR "'URI' argument is required for ZORBA_DECLARE_URI_FILE()")
+  ENDIF (NOT URI_FILE_URI)
+  IF (NOT IS_ABSOLUTE "${URI_FILE_FILE}")
+    SET (SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${URI_FILE_FILE}")
+  ELSE (NOT IS_ABSOLUTE "${URI_FILE_FILE}")
+    SET (SOURCE_FILE "${URI_FILE_FILE}")
+  ENDIF (NOT IS_ABSOLUTE "${URI_FILE_FILE}")
+  GET_FILENAME_COMPONENT (uri_file_name "${URI_FILE_FILE}" NAME)
+  # Don't enforce any extension on general files
+  MANGLE_URI (${URI_FILE_URI} "" uri_file_path uri_file_filename)
+
+  ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${uri_file_path}/${uri_file_filename}"
+    "" "" 1 "${URI_FILE_TEST_ONLY}")
+
+ENDMACRO (DECLARE_ZORBA_URI_FILE)
+
+
+# Inform Zorba of a .jar file that should be made available on the CLASSPATH
+# of the JVM, should the JVM be started. QQQ more doc needed
+#
+# Args: FILE - path to file(s) (must be absolute)
+#       TARGET - (optional) a CMake target that must be executed in order
+#              for FILEs to be generated
+#       EXTERNAL - (optional) FILE specifies a path that should be added
+#              to CLASSPATH as-is
+#       TEST_ONLY - (optional) Jar file is for testcases only and should not
+#              be installed
+#
+# Must supply at least one value to FILE or TARGET.
+MACRO (DECLARE_ZORBA_JAR)
+  PARSE_ARGUMENTS (JAR "FILE;TARGET" "TARGET" "TEST_ONLY;EXTERNAL" ${ARGN})
+  IF (NOT JAR_FILE)
+    MESSAGE (FATAL_ERROR "'FILE' argument is required for DECLARE_ZORBA_JAR")
+  ENDIF (NOT JAR_FILE)
+
+  # Initialize classpath file and set up copy rule (once per project)
+  SET (_CP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-classpath.txt")
+  GET_PROPERTY (_known_project GLOBAL PROPERTY "${PROJECT_NAME}-jars")
+  IF (NOT _known_project)
+    FILE (REMOVE "${_CP_FILE}")
+    SET_PROPERTY (GLOBAL PROPERTY "${PROJECT_NAME}-jars" 1)
+    ADD_COPY_RULE ("LIB" "${_CP_FILE}" "jars/${PROJECT_NAME}-classpath.txt"
+      "" "" 1 "${JAR_TEST_ONLY}")
+  ENDIF (NOT _known_project)
+
+  # Iterate over all supplied jar files
+  FOREACH (_jar_file ${JAR_FILE})
+
+    IF (JAR_EXTERNAL AND NOT ZORBA_PACKAGE_EXTERNAL_JARS)
+      # Put absolute path into classpath file
+      FILE (APPEND "${_CP_FILE}" "${_jar_file}\n")
+    ELSE (JAR_EXTERNAL AND NOT ZORBA_PACKAGE_EXTERNAL_JARS)
+      # Copy jar to jars/ directory and add relative path to classpath file
+      GET_FILENAME_COMPONENT (_output_filename "${_jar_file}" NAME)
+      ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" "" 
+	"${JAR_TARGET}" 1 "${JAR_TEST_ONLY}")
+      FILE (APPEND "${_CP_FILE}" "${_output_filename}\n")
+    ENDIF (JAR_EXTERNAL AND NOT ZORBA_PACKAGE_EXTERNAL_JARS)
+
+  ENDFOREACH (_jar_file)
+ENDMACRO (DECLARE_ZORBA_JAR)
+
+
 # Utility macro for setting up a build rule to copy a file to a
-# particular (possible versioned) file in URI_PATH if such a file has
-# not already been output.
+# particular (possibly versioned) file in a shared directory if such a
+# file has not already been output.
+#
+# FILE_TYPE: Either "URI" or "LIB"; will be used to determine which shared
+#    directory to place output in (URI_PATH or LIB_PATH).
 # INPUT_FILE: Absolute path to file to copy.
 # OUTPUT_FILE: Relative path to output file (relative to URI_PATH).
 # VERSION_ARG: Version; may be "" for non-versioned files.
 # DEPEND_TARGET: A CMake target name upon which the copy rule should depend;
 #    may be "".
+# INSTALL: If 1, an INSTALL() directive will be executed to put the
+#    file into the install image.
 # TEST_ONLY: If 1, file is for testcases only; will be copied into
-#    TEST_URI_PATH and will not be installed
-MACRO (ADD_COPY_RULE INPUT_FILE OUTPUT_FILE VERSION_ARG DEPEND_TARGET TEST_ONLY)
+#    TEST_URI_PATH/TEST_LIB_PATH and will not be installed.
+MACRO (ADD_COPY_RULE FILE_TYPE INPUT_FILE OUTPUT_FILE VERSION_ARG
+       DEPEND_TARGET INSTALL TEST_ONLY)
   # Choose output base directory
   IF (${TEST_ONLY} EQUAL 1)
-    SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_URI_PATH")
+    SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_${FILE_TYPE}_PATH")
   ELSE (${TEST_ONLY} EQUAL 1)
-    SET (_output_basedir "${CMAKE_BINARY_DIR}/URI_PATH")
+    SET (_output_basedir "${CMAKE_BINARY_DIR}/${FILE_TYPE}_PATH")
   ENDIF (${TEST_ONLY} EQUAL 1)
 
   # Compute the modified output filename by inserting VERSION_ARG (if
@@ -404,46 +544,50 @@
   IF (file_found EQUAL -1)
     SET_PROPERTY (GLOBAL APPEND PROPERTY "${_dir_sym}-output-files"
       "${_output_file}")
-    # Save the input file, output file, and any library dependency
-    # target for this rule in a global property
+    # Detect whether this is a core URI or not
+    IF (PROJECT_NAME STREQUAL "zorba")
+      SET (_is_core 1)
+    ELSE (PROJECT_NAME STREQUAL "zorba")
+      SET (_is_core 0)
+    ENDIF (PROJECT_NAME STREQUAL "zorba")
+
+    # Save the (input file, output file, any library dependency
+    # target, and whether this is a core or non-core file) for this
+    # rule in a global property
     SET_PROPERTY (GLOBAL APPEND PROPERTY ZORBA_URI_FILES
-      "${INPUT_FILE}" "${_output_file}" "${DEPEND_TARGET}")
+      "${INPUT_FILE}" "${_output_file}" "${DEPEND_TARGET}" "${_is_core}")
 
-    # For .xq and .xsd files, also set up an INSTALL rule (if not TEST_ONLY).
-    IF (NOT ${TEST_ONLY} EQUAL 1)
-      IF (${_output_ext} STREQUAL ".xq" OR ${_output_ext} STREQUAL ".xsd")
+    # Also set up an INSTALL rule (unless TEST_ONLY).
+    IF ( (${INSTALL} EQUAL 1) AND (NOT ${TEST_ONLY} EQUAL 1) )
         
-        IF(NOT PROJECT_NAME STREQUAL "zorba")
-          STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})   
-          INSTALL (FILES "${INPUT_FILE}"
-            DESTINATION "${ZORBA_MODULES_INSTALL_DIR}/${_output_path}"
-            RENAME "${_output_filename}"
-            COMPONENT "${component_name}")
+      IF(NOT _is_core)
+        STRING(REPLACE "-" "_"  component_name ${PROJECT_NAME})   
+        INSTALL (FILES "${INPUT_FILE}"
+          DESTINATION "${ZORBA_NONCORE_${FILE_TYPE}_DIR}/${_output_path}"
+          RENAME "${_output_filename}"
+          COMPONENT "${component_name}")
           
-          IF (NOT ${component_name}_cpack)
-            SET (${component_name}_cpack 1)
+        IF (NOT ${component_name}_cpack)
+          SET (${component_name}_cpack 1)
         
-            STRING(TOUPPER ${component_name} component_name2)
-            FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_GROUP \"external_modules\")\n")
-            
-            STRING(REPLACE "zorba_" "" component_display_name ${component_name})
-            STRING(REPLACE "_" " " component_display_name ${component_display_name})
-            FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_DISPLAY_NAME \"${component_display_name}\")\n")
-            
-            FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_DESCRIPTION \"Install the functionalities of the ${component_display_name}.\")\n")
-            FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_INSTALL_TYPES Full)\n")
-          ENDIF (NOT ${component_name}_cpack)  
-            
-        ELSE(NOT PROJECT_NAME STREQUAL "zorba")
-          INSTALL (FILES "${INPUT_FILE}"
-          DESTINATION "${ZORBA_MODULES_INSTALL_DIR}/${_output_path}"
+          STRING(TOUPPER ${component_name} component_name2)
+          FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_GROUP \"external_modules\")\n")
+            
+          STRING(REPLACE "zorba_" "" component_display_name ${component_name})
+          STRING(REPLACE "_" " " component_display_name ${component_display_name})
+          FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_DISPLAY_NAME \"${component_display_name}\")\n")
+            
+          FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_DESCRIPTION \"Install the functionalities of the ${component_display_name}.\")\n")
+          FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeCPackModules.cmake "SET(CPACK_COMPONENT_${component_name2}_INSTALL_TYPES Full)\n")
+        ENDIF (NOT ${component_name}_cpack)  
+            
+      ELSE(NOT _is_core)
+        INSTALL (FILES "${INPUT_FILE}"
+          DESTINATION "${ZORBA_CORE_${FILE_TYPE}_DIR}/${_output_path}"
           RENAME "${_output_filename}")
-        ENDIF(NOT PROJECT_NAME STREQUAL "zorba")
-        
-        
+      ENDIF(NOT _is_core)
           
-      ENDIF (${_output_ext} STREQUAL ".xq" OR ${_output_ext} STREQUAL ".xsd")
-    ENDIF (NOT ${TEST_ONLY} EQUAL 1)
+    ENDIF ( (${INSTALL} EQUAL 1) AND (NOT ${TEST_ONLY} EQUAL 1) )
   ENDIF (file_found EQUAL -1)
 ENDMACRO (ADD_COPY_RULE)
 
@@ -478,6 +622,8 @@
 # files to their corresponding output directories, with appropriate
 # dependencies. This macro will only have any effect when called by
 # the top-level project in a build.
+# Also, this function automatically generates a CMake projectConfig.cmake
+# file for the project, based on config/ExternalModuleConfig.cmake.in.
 MACRO (DONE_DECLARING_ZORBA_URIS)
   IF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
     # Close out the zorba modules and schemas manifests
@@ -485,36 +631,71 @@
     IF (POLICY CMP0007)
       CMAKE_POLICY (SET CMP0007 NEW)
     ENDIF (POLICY CMP0007)
-    MESSAGE (STATUS "Creating check_uris target")
+    MESSAGE (STATUS "Creating check_core_uris and check_uris targets")
     GET_PROPERTY (copy_rules GLOBAL PROPERTY ZORBA_URI_FILES)
     SET (_output_files)
     WHILE (copy_rules)
-      # Pop three items off the list, and set up the corresponding
+      # Pop four items off the list, and set up the corresponding
       # rule
       LIST (GET copy_rules 0 _input_file)
       LIST (GET copy_rules 1 _output_file)
       LIST (GET copy_rules 2 _depend_target)
-      LIST (REMOVE_AT copy_rules 0 1 2)
-      SET (_depends "${_input_file}")
+      LIST (GET copy_rules 3 _is_core)
+      LIST (REMOVE_AT copy_rules 0 1 2 3)
       IF (_depend_target)
-        LIST (APPEND _depends "${_depend_target}")
+        SET (_depends "${_depend_target}")
+      ELSE (_depend_target) 
+	SET (_depends "${_input_file}")
       ENDIF (_depend_target)
       ADD_CUSTOM_COMMAND (OUTPUT "${_output_file}"
         COMMAND "${CMAKE_COMMAND}" -E copy
         "${_input_file}" "${_output_file}"
         DEPENDS ${_depends}
         COMMENT "Copying ${_input_file} to URI path" VERBATIM)
-      LIST (APPEND _output_files "${_output_file}")
+      IF (_is_core)
+        LIST (APPEND _core_output_files "${_output_file}")
+      ELSE (_is_core)
+        LIST (APPEND _noncore_output_files "${_output_file}")
+      ENDIF (_is_core)
     ENDWHILE (copy_rules)
-    ADD_CUSTOM_TARGET (check_uris ALL DEPENDS ${_output_files} VERBATIM)
-    SET_TARGET_PROPERTIES(check_uris PROPERTIES
-      FOLDER "Modules"
-    )
+
+    # Targets and dependencies:
+    #   ALL depends on check_uris; check_uris depends on check_core_uris;
+    #   zorbacmd depends on check_core_uris as well as all core module
+    #   library targets.
+    ADD_CUSTOM_TARGET (check_uris ALL
+      DEPENDS ${_noncore_output_files} VERBATIM)
+    SET_TARGET_PROPERTIES(check_uris PROPERTIES FOLDER "Modules")
+    # Only create check_core_uris target and associated dependencies if
+    # there are any core URIs; there should never be any when building a
+    # standalone module project.
+    LIST (LENGTH _core_output_files _num_core)
+    IF (_num_core GREATER 0)
+      ADD_CUSTOM_TARGET (check_core_uris 
+        DEPENDS ${_core_output_files} VERBATIM)
+      ADD_DEPENDENCIES(check_uris check_core_uris)
+      ADD_DEPENDENCIES(zorbacmd check_core_uris)
+      GET_PROPERTY (_corelibs GLOBAL PROPERTY ZORBA_CORE_MODULE_LIB_TARGETS)
+      ADD_DEPENDENCIES(zorbacmd ${_corelibs})
+      SET_TARGET_PROPERTIES(check_core_uris PROPERTIES FOLDER "Modules")
+    ENDIF (_num_core GREATER 0)
     SET_PROPERTY (GLOBAL PROPERTY ZORBA_URI_FILES)
 
     #add 'xqdoc' and 'xqdoc-xml' targets
     ADD_XQDOC_TARGETS()
   ENDIF (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+
+  # Now, do things that should be done at the end of *any* project, not
+  # just the top-level project.
+
+  # Generate project's projectConfig.cmake file.
+  # QQQ need to create an installable version of this too, once we know
+  # how installing a module package should work.
+  GET_PROPERTY (ZORBA_MODULE_LIBRARIES
+    GLOBAL PROPERTY "${PROJECT_NAME}_LIBRARIES")
+  CONFIGURE_FILE("${Zorba_EXTERNALMODULECONFIG_FILE}"
+    "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
+
 ENDMACRO (DONE_DECLARING_ZORBA_URIS)
 
 # Initialize expected failures and zorba modules output files when
@@ -553,56 +734,106 @@
 
 ENDMACRO(expected_failure)
 
-# Convenience macro for adding tests in a standard format.
+# Convenience macro for adding tests in a standard format. All test
+# cases (.xq files) in "Queries" subdirectory of the named directory
+# will be automatically added for CTest. Each test will be named
+# ${PROJECT_NAME}/<filename>, where <filename> is the path relative to
+# the Queries/ subdirectory.
+# 
+# The optional second argument exists for Windows. Normally,
+# EXPECTED_FAILURE() can be used even for tests that crash
+# (segfault). However, on Windows, when a test crashes, it pops up a
+# dialog box. This prevents tests running unattended.  Since it is not
+# possible with CMake to remove a test once added,
+# ADD_TEST_DIRECTORY() needs to be told not to add the test at all on
+# Windows platforms. Therefore, after the directory name, you may
+# additional arguments in the form (testname bugnumber testname
+# bugnumber ...) to ADD_TEST_DIRECTORY().  On Windows, the named tests
+# will be skipped entirely. On other platforms, they will be passed to
+# EXPECTED_FAILURE() with the corresponding bug number.
+#
+# This second argument should only be used for test cases that are 
+# currently *crashing* on Windows. If the test is simply failing, then
+# you should use EXPECTED_FAILURE() after calling ADD_TEST_DIRECTORY().
+#
 # Parameters:
 #   TEST_DIR - all the .xq files in this directory will be added as tests
-#   ARGV1    - if this is present, it will be interpreted as a list of
-#              exceptions. The list items will be removed from the list of
-#              files found in TEST_DIR.
+#   (additional args)  - expected crashing tests, as discussed above.
 MACRO (ADD_TEST_DIRECTORY TEST_DIR)
   # QQQ error-check: Queries directory exists, some tests found...
   FILE(GLOB_RECURSE TESTFILES FOLLOW_SYMLINKS
     RELATIVE "${TEST_DIR}/Queries" "${TEST_DIR}/Queries/*.xq")
 
-  FOREACH (EXCEPTION ${ARGV1})
-    LIST (REMOVE_ITEM TESTFILES ${EXCEPTION})
-  ENDFOREACH (EXCEPTION)
+  # Convert extra arguments to two lists: test names and bug IDs
+  SET (crash_tests)
+  SET (crash_bugids)
+  SET (known_crashes ${ARGN})
+  LIST (LENGTH known_crashes num_crashes)
+  WHILE (num_crashes GREATER 0)
+    LIST (GET known_crashes 0 _testcase)
+    LIST (APPEND crash_tests ${_testcase})
+    LIST (GET known_crashes 1 _bugid)
+    LIST (APPEND crash_bugids ${_bugid})
+    LIST (REMOVE_AT known_crashes 0 1)
+    MATH (EXPR num_crashes "${num_crashes} - 2")
+  ENDWHILE (num_crashes GREATER 0)
 
+  IF(WIN32)
+    SET(PATH_SEP ",")
+  ELSE(WIN32)
+    SET(PATH_SEP ":")
+  ENDIF(WIN32)
   SET(TESTCOUNTER 0)
   FOREACH(TESTFILE ${TESTFILES})
     SET(TESTNAME "${PROJECT_NAME}/${TESTFILE}")
 
-    IF(WIN32)
-      SET(PATH_SEP ",")
-    ELSE(WIN32)
-      SET(PATH_SEP ":")
-    ENDIF(WIN32)
-    ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
-      "--rbkt-src" "${TEST_DIR}"
-      "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${SECONDARY_MODULE_PATHS}"
-      "${TESTFILE}")
-
-    MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
-    MATH(EXPR TESTMOD "${TESTCOUNTER}%100")
-    IF (${TESTMOD} EQUAL 0)
-      MESSAGE(STATUS "Adding another 100 Tests")
-    ENDIF (${TESTMOD} EQUAL 0)
+    # See if this test is in the known-crashing list
+    SET (_crash_bugid)
+    LIST (FIND crash_tests ${TESTNAME} _crash_idx)
+    IF (${_crash_idx} GREATER -1)
+      # Get corresponding bug ID
+      LIST (GET crash_bugids ${_crash_idx} _crash_bugid)
+      # Remove from known-crashing list
+      LIST (REMOVE_AT crash_tests ${_crash_idx})
+    ENDIF (${_crash_idx} GREATER -1)
+
+    # On Windows, skip calling ADD_TEST() for any known crashing tests
+    IF (WIN32 AND (${_crash_idx} GREATER -1) )
+      MESSAGE (STATUS "WARNING: Skipping test case ${TESTNAME} which is expected to crash - bug ${_crash_bugid}")
+    ELSE (WIN32 AND (${_crash_idx} GREATER -1) )
+      # DEPENDENCY_MODULE_PATH will always start with an appropriate
+      # path separator
+      ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
+	"--rbkt-src" "${TEST_DIR}"
+	"--module-path"
+	"${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${DEPENDENCY_MODULE_PATH}"
+	"${TESTFILE}")
+
+      # On non-Windows, call EXPECTED_FAILURE() for known crashes
+      IF (${_crash_idx} GREATER -1)
+	MESSAGE (STATUS "Marking test case ${TESTNAME} as expected to crash - bug ${bugid}")
+	EXPECTED_FAILURE (${TESTNAME} ${_bugid})
+      ENDIF (${_crash_idx} GREATER -1)
+
+      MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
+      MATH(EXPR TESTMOD "${TESTCOUNTER}%100")
+      IF (${TESTMOD} EQUAL 0)
+	MESSAGE(STATUS "Adding another 100 Tests")
+      ENDIF (${TESTMOD} EQUAL 0)
+
+    ENDIF (WIN32 AND (${_crash_idx} GREATER -1) )
+
   ENDFOREACH(TESTFILE)
+
+  # Ensure that known-crashes list is empty - otherwise some tests were
+  # named that didn't exist
+  IF (NOT "${crash_tests}" STREQUAL "")
+    MESSAGE (FATAL_ERROR "The following non-existing test cases were passed to ADD_TEST_DIRECTORY(): ${crash_tests}")
+  ENDIF (NOT "${crash_tests}" STREQUAL "")
+
   MESSAGE(STATUS "Added ${TESTCOUNTER} tests in ${TEST_DIR}")
 ENDMACRO (ADD_TEST_DIRECTORY)
 
-# Macro to install a basic CMake config file for a module. Provide a
-# source and binary directory. Result will be installed in binary
-# directory. This is a macro because it is called from two different
-# places: ZorbaUse.cmake, and Zorba's modules/CMakeLists.txt.
-MACRO(CREATE_MODULE_CONFIG name src_dir bin_dir)
-  # Set variables referenced in ExternalModuleConfig.cmake.in
-  SET(MODULE_SOURCE_DIR ${src_dir})
-  SET(MODULE_BINARY_DIR ${bin_dir})
-  CONFIGURE_FILE("${Zorba_EXTERNALMODULECONFIG_FILE}"
-    "${MODULE_BINARY_DIR}/${name}Config.cmake" @ONLY)
-ENDMACRO(CREATE_MODULE_CONFIG)
-
 # This macro easies the process of adding test for store dependent
 # executables. It has the same naming convection for the target as the
 # macro that is used to generated store dependent executables (thus,
@@ -695,7 +926,7 @@
       COMMENT "Building XQDoc XML documentation ..."
   )
   MESSAGE(STATUS "  added target xqdoc-xml")
-  ADD_DEPENDENCIES(xqdoc-xml zorba_simplestore)
+  ADD_DEPENDENCIES(xqdoc-xml zorbacmd check_core_uris)
 
   SET_TARGET_PROPERTIES (xqdoc-xml PROPERTIES
     EXCLUDE_FROM_DEFAULT_BUILD 1
@@ -719,7 +950,7 @@
       COMMENT "Building XQDoc XHTML documentation ..."
   )
   MESSAGE(STATUS "  added target xqdoc")
-  ADD_DEPENDENCIES(xqdoc xqdoc-xml)
+  ADD_DEPENDENCIES(xqdoc xqdoc-xml modules_svg)
   SET_TARGET_PROPERTIES (xqdoc PROPERTIES
     EXCLUDE_FROM_DEFAULT_BUILD 1
     FOLDER "Docs"
@@ -738,3 +969,26 @@
   MESSAGE(STATUS "  added test test/xqdoc/make_xqdoc")
   MESSAGE(STATUS "ADD_XQDOC_TARGETS END")
 ENDMACRO(ADD_XQDOC_TARGETS)
+
+
+# Macro that takes care of the CMake module path in a project. This will prepend
+# "cmake_modules" and "cmake_modules/Windows" to the existing CMAKE_MODULE_PATH
+MACRO (SET_CMAKE_MODULE_PATH)
+
+  # first we prepend the "cmake_modules" directory in the project root
+  SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ${CMAKE_MODULE_PATH})
+
+  # now we prepend the "cmake_modules/Windows" directory in the project root
+  # this takes care about the finding and installing DLL for these libraries
+  IF (WIN32)
+    # Since the user can install libraries on Windows at any location we use
+    # proxy modules that try to guess first the location of the required third
+    # party libraries. This will search in order in:
+    # 1. the path pointed by ZORBA_THIRD_PARTY_REQUIREMENTS
+    # 2. the Program Files directory available on the users computer
+    # 3. the PATH environment variable
+    # The logic is implemented by the macros in the ProxyFindModule.cmake module.
+    SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/Windows ${CMAKE_MODULE_PATH})
+  ENDIF (WIN32)
+  
+ENDMACRO (SET_CMAKE_MODULE_PATH)

=== modified file 'config/CMakeLists.txt'
--- config/CMakeLists.txt	2011-09-08 19:19:54 +0000
+++ config/CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -34,7 +34,8 @@
 SET(Zorba_EXE_PATH "${ZORBA_ROOT}/bin/zorba")
 SET(Zorba_EXTERNALMODULECONFIG_FILE
   "${ZORBA_ROOT}/${ZORBA_CMAKE_DIR}/ExternalModuleConfig.cmake.in")   
-SET(Zorba_MODULES_INSTALL_DIR "${ZORBA_ROOT}/${ZORBA_MODULES_INSTALL_DIR}")
+SET(Zorba_NONCORE_URI_DIR "${ZORBA_ROOT}/${ZORBA_NONCORE_URI_DIR}")
+SET(Zorba_NONCORE_LIB_DIR "${ZORBA_ROOT}/${ZORBA_NONCORE_LIB_DIR}")
 
 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ZorbaConfig.cmake.in"
   "${CMAKE_CURRENT_BINARY_DIR}/ZorbaConfig.cmake" @ONLY)
@@ -58,7 +59,7 @@
   STRING (REPLACE ".exe" ".bat" Zorba_TESTDRIVER ${Zorba_TESTDRIVER})
 ENDIF (WIN32)
 
-SET(Zorba_EXE_PATH     "${ZORBA_EXE}")
+SET(Zorba_EXE_PATH "${ZORBA_EXE}")
 SET(Zorba_EXTERNALMODULECONFIG_FILE
   "${CMAKE_CURRENT_SOURCE_DIR}/ExternalModuleConfig.cmake.in")
 # Note: We also set these two into the parent's scope, so that it is
@@ -67,10 +68,9 @@
   "${CMAKE_CURRENT_SOURCE_DIR}/ExternalModuleConfig.cmake.in"
   PARENT_SCOPE)
 SET(Zorba_EXE "${ZORBA_EXE}" PARENT_SCOPE)
+SET(Zorba_NONCORE_URI_DIR "${ZORBA_NONCORE_URI_DIR}")
+SET(Zorba_NONCORE_LIB_DIR "${ZORBA_NONCORE_LIB_DIR}")
 
-# Note: This value doesn't really make much sense, but neither does any
-# other value
-SET(Zorba_MODULES_INSTALL_DIR "${ZORBA_MODULES_INSTALL_DIR}")
 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ZorbaConfig.cmake.in"
   "${CMAKE_BINARY_DIR}/ZorbaConfig.cmake" @ONLY)
 
@@ -99,3 +99,4 @@
 
 ADD_SUBDIRECTORY(fedora)
 ADD_SUBDIRECTORY(debian)
+ADD_SUBDIRECTORY(thesaurus)

=== modified file 'config/ExternalModuleConfig.cmake.in'
--- config/ExternalModuleConfig.cmake.in	2011-06-24 19:58:33 +0000
+++ config/ExternalModuleConfig.cmake.in	2012-08-19 03:54:29 +0000
@@ -12,12 +12,29 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-IF(WIN32)
-  SET(PATH_SEP ",")
-ELSE(WIN32)
-  SET(PATH_SEP ":")
-ENDIF(WIN32)
-
-# QQQ When all the module versioning and external-module work is
-# complete, this should contain ONLY MODULE_BINARY_DIR/modules.
-SET(SECONDARY_MODULE_PATHS "${SECONDARY_MODULE_PATHS}${PATH_SEP}@MODULE_SOURCE_DIR@/src/${PATH_SEP}@MODULE_BINARY_DIR@/src/${PATH_SEP}@MODULE_BINARY_DIR@/modules/")
+IF (WIN32)
+  SET (PATH_SEP ",")
+ELSE (WIN32)
+  SET (PATH_SEP ":")
+ENDIF (WIN32)
+
+# Probably should have separate URI and LIB paths here someday; will
+# require testdriver to accept --uri-path and --lib-path args
+# Note that this path is meaningless if the module is installed; see
+# bug 966999.
+SET (DEPENDENCY_MODULE_PATH 
+  "${DEPENDENCY_MODULE_PATH}${PATH_SEP}@PROJECT_BINARY_DIR@/URI_PATH/${PATH_SEP}${DEPENDENCY_LIB_PATH}${PATH_SEP}@PROJECT_BINARY_DIR@/LIB_PATH/")
+
+# Dynamic libraries created by this project to link against
+SET (@PROJECT_NAME@_LIBRARIES @ZORBA_PROJECT_LIBRARIES@ @ZORBA_MODULE_LIBRARIES@)
+
+# Include directories exported by this project
+SET (@PROJECT_NAME@_INCLUDE_DIRS @ZORBA_PROJECT_INCLUDE_DIRS@)
+
+# Offer a "use file" to the user of this module. For most module
+# packages, this is unnecessary. However it can be utilized by
+# advanced packages which wish to, for example, export a C++ header
+# file to dependent packages. As above, note that this currently is
+# non-functional if this module package is installed; this will only
+# work from a project build directory.
+SET (@PROJECT_NAME@_USE_FILE "@ZORBA_PROJECT_USE_FILE@")

=== modified file 'config/ZorbaConfig.cmake.in'
--- config/ZorbaConfig.cmake.in	2011-08-24 09:09:02 +0000
+++ config/ZorbaConfig.cmake.in	2012-08-19 03:54:29 +0000
@@ -47,10 +47,13 @@
   "Path to Zorba's testdriver" FORCE)
 SET_NORMALIZED (Zorba_EXE "@Zorba_EXE_PATH@" CACHE PATH "Path to Zorba executable" FORCE)
 
-# Tell the user project where modules are installed. Note: This variable
-# is all-uppercase because it is also used internally by Zorba's build.
-SET (ZORBA_MODULES_INSTALL_DIR "@Zorba_MODULES_INSTALL_DIR@"
-  CACHE STRING "Path to Zorba modules in this Zorba installation" FORCE)
+# Tell the user project where (non-core) modules are installed. Note:
+# These variables are all-uppercase because they are also used
+# internally by Zorba's build.
+SET (ZORBA_NONCORE_URI_DIR "@Zorba_NONCORE_URI_DIR@"
+  CACHE STRING "Path to Zorba to non-core modules/schemas in this Zorba installation" FORCE)
+SET (ZORBA_NONCORE_LIB_DIR "@Zorba_NONCORE_LIB_DIR@"
+  CACHE STRING "Path to Zorba to non-core libraries in this Zorba installation" FORCE)
 
 # Tell the user project where to find the "USE" file.
 # This file uses the above settings to configure the user project.

=== modified file 'config/ZorbaUse.cmake'
--- config/ZorbaUse.cmake	2011-05-19 05:06:55 +0000
+++ config/ZorbaUse.cmake	2012-08-19 03:54:29 +0000
@@ -31,7 +31,3 @@
   # Load Zorba module support macros.
   INCLUDE("${Zorba_CMAKE_MODULES_DIR}/Windows/ProxyFindModule.cmake")
 ENDIF(WIN32)
-
-# Generate project's projectConfig.cmake file.
-CREATE_MODULE_CONFIG(${PROJECT_NAME} "${PROJECT_SOURCE_DIR}"
-  "${PROJECT_BINARY_DIR}")

=== added directory 'config/thesaurus'
=== added file 'config/thesaurus/CMakeLists.txt'
--- config/thesaurus/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ config/thesaurus/CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -0,0 +1,26 @@
+# Copyright 2006-2010 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.
+
+#Add wordnet-en.zth to the correct directory
+IF(ZORBA_WITH_THESAURUS)
+  CONFIGURE_FILE(
+    "${CMAKE_CURRENT_SOURCE_DIR}/wordnet-en.zth"
+    "${CMAKE_BINARY_DIR}/LIB_PATH/edu/princeton/wordnet/wordnet-en.zth" 
+    COPYONLY
+  )
+
+  INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/wordnet-en.zth"
+    DESTINATION "${ZORBA_CORE_LIB_DIR}/edu/princeton/wordnet"
+    COMPONENT thesaurus)
+ENDIF(ZORBA_WITH_THESAURUS)

=== added file 'config/thesaurus/wordnet-en.zth'
Binary files config/thesaurus/wordnet-en.zth	1970-01-01 00:00:00 +0000 and config/thesaurus/wordnet-en.zth	2012-08-19 03:54:29 +0000 differ
=== modified file 'doc/CMakeLists.txt'
--- doc/CMakeLists.txt	2011-08-26 22:46:24 +0000
+++ doc/CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -40,9 +40,12 @@
 
 IF (SWIG_FOUND)
   ADD_SUBDIRECTORY(java)
+  ADD_SUBDIRECTORY(xqj)
   ADD_SUBDIRECTORY(python)
   ADD_SUBDIRECTORY(ruby)
   ADD_SUBDIRECTORY(php)
+  ADD_SUBDIRECTORY(csharp)
+  
 ENDIF (SWIG_FOUND)
 
 # generate Doxygen code documentation
@@ -90,6 +93,14 @@
   INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ruby/html  
         COMPONENT "doc"
         DESTINATION share/doc/zorba-${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}/ruby)
+
+  INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xqj/html 
+        COMPONENT "doc"
+        DESTINATION share/doc/zorba-${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}/xqj)
+        
+  INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csharp/html 
+        COMPONENT "doc"
+        DESTINATION share/doc/zorba-${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}/csharp)        
 ENDIF (SWIG_FOUND)
 
 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zorba/html 

=== modified file 'doc/c/doxy.config.in'
--- doc/c/doxy.config.in	2011-06-30 20:03:46 +0000
+++ doc/c/doxy.config.in	2012-08-19 03:54:29 +0000
@@ -1,442 +1,623 @@
-# Doxyfile 1.4.5
+# Doxyfile 1.7.5
 
 # This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
 #
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a hash (#) is considered a comment and will be ignored.
 # The format is:
 #       TAG = value [value, ...]
 # For lists items can also be appended using:
 #       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# Values that contain spaces should be placed between quotes (" ").
 
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = Zorba C-API
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Zorba C-API"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
 PROJECT_NUMBER         = @ZORBA_MAJOR_NUMBER@.@ZORBA_MINOR_NUMBER@.@ZORBA_PATCH_NUMBER@
 
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
 # where doxygen was started. If left blank the current directory will be used.
 
 OUTPUT_DIRECTORY       = @CMAKE_CURRENT_BINARY_DIR@
 
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
 # otherwise cause performance problems for the file system.
 
 CREATE_SUBDIRS         = NO
 
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
-# Swedish, and Ukrainian.
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
 
 OUTPUT_LANGUAGE        = English
 
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
 # Set to NO to disable this.
 
 BRIEF_MEMBER_DESC      = YES
 
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
 # brief descriptions will be completely suppressed.
 
 REPEAT_BRIEF           = YES
 
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
 # "represents" "a" "an" "the"
 
-ABBREVIATE_BRIEF       = 
+ABBREVIATE_BRIEF       =
 
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
 # description.
 
 ALWAYS_DETAILED_SEC    = NO
 
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
-# inherited members of a class in the documentation of that class as if those 
-# members were ordinary class members. Constructors, destructors and assignment 
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
 # operators of the base classes will not be shown.
 
 INLINE_INHERITED_MEMB  = YES
 
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
 # to NO the shortest path that makes the file name unique will be used.
 
 FULL_PATH_NAMES        = NO
 
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user-defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
 # path to strip.
 
-STRIP_FROM_PATH        = @CMAKE_SOURCE_DIR@/src @CMAKE_BINARY_DIR@/src
-
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
+STRIP_FROM_PATH        = @CMAKE_SOURCE_DIR@/src \
+                         @CMAKE_BINARY_DIR@/src
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
 # are normally passed to the compiler using the -I flag.
 
-STRIP_FROM_INC_PATH    = @CMAKE_SOURCE_DIR@/include @CMAKE_BINARY_DIR@/include
+STRIP_FROM_INC_PATH    = @CMAKE_SOURCE_DIR@/include \
+                         @CMAKE_BINARY_DIR@/include
 
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
 # doesn't support long names like on DOS, Mac, or CD-ROM.
 
 SHORT_NAMES            = NO
 
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the JavaDoc 
-# comments will behave just like the Qt-style comments (thus requiring an 
-# explicit @brief command for a brief description.
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
 
 JAVADOC_AUTOBRIEF      = YES
 
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
-# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
-# comments) as a brief description. This used to be the default behaviour. 
-# The new default is to treat a multi-line C++ comment block as a detailed 
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
 # description. Set this tag to YES if you prefer the old behaviour instead.
 
 MULTILINE_CPP_IS_BRIEF = NO
 
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member 
-# documentation.
-
-DETAILS_AT_TOP         = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
 # re-implements.
 
 INHERIT_DOCS           = YES
 
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
 # be part of the file/class/namespace that contains it.
 
 SEPARATE_MEMBER_PAGES  = NO
 
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
 # Doxygen uses this value to replace tabs by spaces in code fragments.
 
 TAB_SIZE               = 2
 
-# This tag can be used to specify a number of aliases that acts 
-# as commands in the documentation. An alias has the form "name=value". 
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
-# put the command \sideeffect (or @sideeffect) in the documentation, which 
-# will result in a user-defined paragraph with heading "Side Effects:". 
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
 # You can put \n's in the value part of an alias to insert newlines.
 
-ALIASES                = 
+ALIASES                =
 
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
-# sources only. Doxygen will then generate output that is more tailored for C. 
-# For instance, some of the names that are used will be different. The list 
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
 # of all members will be omitted, etc.
 
 OPTIMIZE_OUTPUT_FOR_C  = YES
 
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
-# sources only. Doxygen will then generate output that is more tailored for Java. 
-# For instance, namespaces will be presented as packages, qualified scopes 
-# will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
 
 OPTIMIZE_OUTPUT_JAVA   = NO
 
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
-# include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
 # diagrams that involve STL classes more complete and accurate.
 
-# BUILTIN_STL_SUPPORT    = NO
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
-# tag is set to YES, then doxygen will reuse the documentation of the first 
-# member in the group (if any) for the other members of the group. By default 
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
 # all members of a group must be documented explicitly.
 
 DISTRIBUTE_GROUP_DOC   = NO
 
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
 # the \nosubgrouping command.
 
 SUBGROUPING            = YES
 
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
 #---------------------------------------------------------------------------
 # Build related configuration options
 #---------------------------------------------------------------------------
 
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
 EXTRACT_ALL            = YES
 
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
 EXTRACT_PRIVATE        = NO
 
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
 
 EXTRACT_STATIC         = NO
 
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
-# defined locally in source files will be included in the documentation. 
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
 # If set to NO only classes defined in header files are included.
 
 EXTRACT_LOCAL_CLASSES  = YES
 
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
 # If set to NO (the default) only methods in the interface are included.
 
 EXTRACT_LOCAL_METHODS  = NO
 
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
 # This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_MEMBERS     = YES
 
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these classes will be included in the various 
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
 # overviews. This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_CLASSES     = YES
 
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
-# friend (class|struct|union) declarations. 
-# If set to NO (the default) these declarations will be included in the 
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
 # documentation.
 
 HIDE_FRIEND_COMPOUNDS  = NO
 
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
-# documentation blocks found inside the body of a function. 
-# If set to NO (the default) these blocks will be appended to the 
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
 # function's detailed documentation block.
 
 HIDE_IN_BODY_DOCS      = NO
 
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
 # Set it to YES to include the internal documentation.
 
 INTERNAL_DOCS          = NO
 
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
-# file names in lower-case letters. If set to YES upper-case letters are also 
-# allowed. This is useful if you have classes or files whose names only differ 
-# in case and if your file system supports case sensitive file names. Windows 
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
 # and Mac users are advised to set this option to NO.
 
 CASE_SENSE_NAMES       = YES
 
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
 # documentation. If set to YES the scope will be hidden.
 
 HIDE_SCOPE_NAMES       = NO
 
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
 # of that file.
 
 SHOW_INCLUDE_FILES     = YES
 
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
 # is inserted in the documentation for inline members.
 
 INLINE_INFO            = YES
 
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
 # declaration order.
 
 SORT_MEMBER_DOCS       = YES
 
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
 # declaration order.
 
 SORT_BRIEF_DOCS        = YES
 
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
 # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the 
+# Note: This option applies only to the class list, not to the
 # alphabetical list.
 
 SORT_BY_SCOPE_NAME     = NO
 
-# The GENERATE_TODOLIST tag can be used to enable (YES) or 
-# disable (NO) the todo list. This list is created by putting \todo 
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
 # commands in the documentation.
 
 GENERATE_TODOLIST      = YES
 
-# The GENERATE_TESTLIST tag can be used to enable (YES) or 
-# disable (NO) the test list. This list is created by putting \test 
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
 # commands in the documentation.
 
 GENERATE_TESTLIST      = YES
 
-# The GENERATE_BUGLIST tag can be used to enable (YES) or 
-# disable (NO) the bug list. This list is created by putting \bug 
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
 # commands in the documentation.
 
 GENERATE_BUGLIST       = YES
 
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
-# disable (NO) the deprecated list. This list is created by putting 
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
 # \deprecated commands in the documentation.
 
 GENERATE_DEPRECATEDLIST= YES
 
-# The ENABLED_SECTIONS tag can be used to enable conditional 
+# The ENABLED_SECTIONS tag can be used to enable conditional
 # documentation sections, marked by \if sectionname ... \endif.
 
 ENABLED_SECTIONS       =
 
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consists of for it to appear in 
-# the documentation. If the initializer consists of more lines than specified 
-# here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
-# documentation can be controlled using \showinitializer or \hideinitializer 
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
 # command in the documentation regardless of this setting.
 
 MAX_INITIALIZER_LINES  = 30
 
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
-# at the bottom of the documentation of classes and structs. If set to YES the 
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
 # list will mention the files that were used to generate the documentation.
 
 SHOW_USED_FILES        = YES
 
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
-# in the documentation. The default is YES.
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
 
 SHOW_DIRECTORIES       = YES
 
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from the 
-# version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
 # is used as the file version. See the manual for examples.
 
-FILE_VERSION_FILTER    = 
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE.
+
+CITE_BIB_FILES         =
 
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
 
-# The QUIET tag can be used to turn on/off the messages that are generated 
+# The QUIET tag can be used to turn on/off the messages that are generated
 # by doxygen. Possible values are YES and NO. If left blank NO is used.
 
 QUIET                  = NO
 
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
 # NO is used.
 
 WARNINGS               = YES
 
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
 # automatically be disabled.
 
 WARN_IF_UNDOCUMENTED   = YES
 
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
 # don't exist or using markup commands wrongly.
 
 WARN_IF_DOC_ERROR      = YES
 
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
 # documentation.
 
 WARN_NO_PARAMDOC       = NO
 
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
 # be obtained via FILE_VERSION_FILTER)
 
 WARN_FORMAT            = @DOXY_WARN_FORMAT@
 
-# The WARN_LOGFILE tag can be used to specify a file to which warning 
-# and error messages should be written. If left blank the output is written 
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
 # to stderr.
 
 WARN_LOGFILE           = Doc/doxy.log
@@ -445,9 +626,9 @@
 # configuration options related to the input files
 #---------------------------------------------------------------------------
 
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
 INPUT                  = @CMAKE_SOURCE_DIR@/include/zorba/zorbac.h \
@@ -455,140 +636,176 @@
                          @CMAKE_SOURCE_DIR@/include/zorba/static_context_consts.h \
                          @CMAKE_SOURCE_DIR@/include/zorba/options.h \
                          @CMAKE_CURRENT_SOURCE_DIR@/manual
-                          
-
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
-
-FILE_PATTERNS          = *.h *.dox
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
-# should be searched for input files as well. Possible values are YES and NO. 
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          = *.h \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
 # If left blank NO is used.
 
 RECURSIVE              = YES
 
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                = 
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
-# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# Note that relative paths are relative to directory from which doxygen is run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
 # from the input.
 
 EXCLUDE_SYMLINKS       = NO
 
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
 # for example use the pattern */test/*
 
 EXCLUDE_PATTERNS       = */.svn \
                          */.svn/*
 
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
 # the \include command).
 
 EXAMPLE_PATH           = @CMAKE_CURRENT_SOURCE_DIR@/examples
 
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
 # blank all files are included.
 
 EXAMPLE_PATTERNS       = *.c
 
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
-# searched for input files to be used with the \include or \dontinclude 
-# commands irrespective of the value of the RECURSIVE tag. 
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
 # Possible values are YES and NO. If left blank NO is used.
 
 EXAMPLE_RECURSIVE      = YES
 
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
 # the \image command).
 
 IMAGE_PATH             = @CMAKE_CURRENT_SOURCE_DIR@
 
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
 # ignored.
 
-INPUT_FILTER           = 
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
-
-FILTER_PATTERNS        = 
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
-# INPUT_FILTER) will be used to filter the input files when producing source 
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
 # files to browse (i.e. when SOURCE_BROWSER is set to YES).
 
 FILTER_SOURCE_FILES    = NO
 
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
 
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources. 
-# Note: To get rid of all source code in the generated output, make sure also 
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
 # VERBATIM_HEADERS is set to NO.
 
 SOURCE_BROWSER         = YES
 
-# Setting the INLINE_SOURCES tag to YES will include the body 
+# Setting the INLINE_SOURCES tag to YES will include the body
 # of functions and classes directly in the documentation.
 
 INLINE_SOURCES         = NO
 
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
 # fragments. Normal C and C++ comments will always remain visible.
 
 STRIP_CODE_COMMENTS    = NO
 
-# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
-# then for each documented function all documented 
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
 # functions referencing it will be listed.
 
 REFERENCED_BY_RELATION = YES
 
-# If the REFERENCES_RELATION tag is set to YES (the default) 
-# then for each documented function all documented entities 
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
 # called/used by that function will be listed.
 
 REFERENCES_RELATION    = YES
 
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
 # will need version 4.8.6 or higher.
 
 USE_HTAGS              = NO
 
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
 # which an include is specified. Set to NO to disable this.
 
 VERBATIM_HEADERS       = YES
@@ -597,281 +814,548 @@
 # configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
 # contains a lot of classes, structs, unions or interfaces.
 
 ALPHABETICAL_INDEX     = YES
 
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
 # in which this list will be split (can be a number in the range [1..20])
 
 COLS_IN_ALPHA_INDEX    = 2
 
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
 # should be ignored while generating the index headers.
 
-IGNORE_PREFIX          = 
+IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
 # configuration options related to the HTML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
 # generate HTML output.
 
 GENERATE_HTML          = YES
 
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `html' will be used as the default path.
 
 HTML_OUTPUT            = html
 
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
 # doxygen will generate files with .html extension.
 
 HTML_FILE_EXTENSION    = .html
 
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard header.
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is adviced to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
 HTML_HEADER            = @CMAKE_CURRENT_SOURCE_DIR@/../style/header.html
 
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
 # standard footer.
 
 HTML_FOOTER            = @CMAKE_CURRENT_SOURCE_DIR@/../style/footer.html
 
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML documentation will contain the timesstamp.
+
+HTML_TIMESTAMP         = NO
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
 # stylesheet in the HTML output directory as well, or it will be erased!
 
 HTML_STYLESHEET        = @CMAKE_CURRENT_SOURCE_DIR@/../style/stylesheet.css
 
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
 # NO a bullet list will be used.
 
 HTML_ALIGN_MEMBERS     = YES
 
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
 # of the generated HTML documentation.
 
 GENERATE_HTMLHELP      = YES
 
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
-# be used to specify the file name of the resulting .chm file. You 
-# can add a path in front of the file if the result should not be 
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
 # written to the html output directory.
 
-CHM_FILE               = 
+CHM_FILE               =
 
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
-# be used to specify the location (absolute path including file name) of 
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
 # the HTML help compiler on the generated index.hhp.
 
-HHC_LOCATION           = 
+HHC_LOCATION           =
 
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
-# controls if a separate .chi index file is generated (YES) or that 
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
 # it should be included in the master .chm file (NO).
 
 GENERATE_CHI           = NO
 
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
-# controls whether a binary table of contents is generated (YES) or a 
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
 # normal table of contents (NO) in the .chm file.
 
 BINARY_TOC             = NO
 
-# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
 # to the contents of the HTML help documentation and to the tree view.
 
 TOC_EXPAND             = NO
 
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters";>
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes";>
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
 # the value YES disables it.
 
 DISABLE_INDEX          = NO
 
-# This tag can be used to set the number of enum values (range [1..20]) 
-# that doxygen will group on one line in the generated HTML documentation.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
 
 ENUM_VALUES_PER_LINE   = 4
 
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that 
-# is generated for HTML Help). For this to work a browser that supports 
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
-# probably better off using the HTML help feature.
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
 
 GENERATE_TREEVIEW      = NO
 
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
-# used to set the initial width (in pixels) of the frame in which the tree 
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
 # is shown.
 
 TREEVIEW_WIDTH         = 250
 
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
 # generate Latex output.
 
 GENERATE_LATEX         = NO
 
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `latex' will be used as the default path.
 
 LATEX_OUTPUT           = latex
 
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
 # invoked. If left blank `latex' will be used as the default command name.
-
-#LATEX_CMD_NAME         = latex
-LATEX_CMD_NAME          = @LATEX_COMPILER@
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
-# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = @LATEX_COMPILER@
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
 # default command name.
 
-#MAKEINDEX_CMD_NAME     = makeindex
 MAKEINDEX_CMD_NAME     = @MAKEINDEX_COMPILER@
 
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
 # save some trees in general.
 
 COMPACT_LATEX          = NO
 
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
 # executive. If left blank a4wide will be used.
 
 PAPER_TYPE             = a4
 
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
 # packages that should be included in the LaTeX output.
 
-EXTRA_PACKAGES         = 
+EXTRA_PACKAGES         =
 
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
 # standard header. Notice: only use this tag if you know what you are doing!
 
-LATEX_HEADER           = 
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
 # This makes the output suitable for online browsing using a pdf viewer.
 
 PDF_HYPERLINKS         = YES
 
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
-# plain latex in the generated Makefile. Set this option to YES to get a 
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
 # higher quality PDF documentation.
 
 USE_PDFLATEX           = YES
 
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
 # This option is also used when generating formulas in HTML.
 
 LATEX_BATCHMODE        = YES
 
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
 # in the output.
 
 LATEX_HIDE_INDICES     = NO
 
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
 #---------------------------------------------------------------------------
 # configuration options related to the RTF output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# The RTF output is optimized for Word 97 and may not look very pretty with 
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
 # other RTF readers or editors.
 
 GENERATE_RTF           = NO
 
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `rtf' will be used as the default path.
 
 RTF_OUTPUT             = rtf
 
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
 # save some trees in general.
 
 COMPACT_RTF            = NO
 
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using WORD or other 
-# programs which support those fields. 
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
 # Note: wordpad (write) and others do not support links.
 
 RTF_HYPERLINKS         = NO
 
-# Load stylesheet definitions from file. Syntax is similar to doxygen's 
-# config file, i.e. a series of assignments. You only have to provide 
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
 # replacements, missing definitions are set to their default value.
 
-RTF_STYLESHEET_FILE    = 
+RTF_STYLESHEET_FILE    =
 
-# Set optional variables used in the generation of an rtf document. 
+# Set optional variables used in the generation of an rtf document.
 # Syntax is similar to doxygen's config file.
 
-RTF_EXTENSIONS_FILE    = 
+RTF_EXTENSIONS_FILE    =
 
 #---------------------------------------------------------------------------
 # configuration options related to the man page output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
 # generate man pages
 
 GENERATE_MAN           = NO
 
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `man' will be used as the default path.
 
 MAN_OUTPUT             = man
 
-# The MAN_EXTENSION tag determines the extension that is added to 
+# The MAN_EXTENSION tag determines the extension that is added to
 # the generated man pages (default is the subroutine's section .3)
 
 MAN_EXTENSION          = .3
 
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
-# then it will generate one additional man file for each entity 
-# documented in the real man page(s). These additional files 
-# only source the real man page, but without them the man command 
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
 # would be unable to find the correct page. The default is NO.
 
 MAN_LINKS              = NO
@@ -880,33 +1364,33 @@
 # configuration options related to the XML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_XML tag is set to YES Doxygen will 
-# generate an XML file that captures the structure of 
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
 # the code including all documentation.
 
 GENERATE_XML           = NO
 
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `xml' will be used as the default path.
 
 XML_OUTPUT             = xml
 
-# The XML_SCHEMA tag can be used to specify an XML schema, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_SCHEMA             = 
-
-# The XML_DTD tag can be used to specify an XML DTD, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_DTD                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
 # enabling this will significantly increase the size of the XML output.
 
 XML_PROGRAMLISTING     = YES
@@ -915,10 +1399,10 @@
 # configuration options for the AutoGen Definitions output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
-# generate an AutoGen Definitions (see autogen.sf.net) file 
-# that captures the structure of the code including all 
-# documentation. Note that this feature is still experimental 
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
 # and incomplete at the moment.
 
 GENERATE_AUTOGEN_DEF   = NO
@@ -927,286 +1411,359 @@
 # configuration options related to the Perl module output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
-# generate a Perl module file that captures the structure of 
-# the code including all documentation. Note that this 
-# feature is still experimental and incomplete at the 
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
 # moment.
 
 GENERATE_PERLMOD       = NO
 
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
 # to generate PDF and DVI output from the Perl module output.
 
 PERLMOD_LATEX          = NO
 
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
-# nicely formatted so it can be parsed by a human reader.  This is useful 
-# if you want to understand what is going on.  On the other hand, if this 
-# tag is set to NO the size of the Perl module output will be much smaller 
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
 # and Perl will parse it just the same.
 
 PERLMOD_PRETTY         = YES
 
-# The names of the make variables in the generated doxyrules.make file 
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
-# This is useful so different doxyrules.make files included by the same 
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
 # Makefile don't overwrite each other's variables.
 
-PERLMOD_MAKEVAR_PREFIX = 
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
 # files.
 
 ENABLE_PREPROCESSING   = YES
 
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. Macro expansion can be done in a controlled 
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
 # way by setting EXPAND_ONLY_PREDEF to YES.
 
 MACRO_EXPANSION        = YES
 
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
 # PREDEFINED and EXPAND_AS_DEFINED tags.
 
 EXPAND_ONLY_PREDEF     = YES
 
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
 
 SEARCH_INCLUDES        = YES
 
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
 # the preprocessor.
 
-INCLUDE_PATH           = 
+INCLUDE_PATH           =
 
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
-# patterns (like *.h and *.hpp) to filter out the header-files in the 
-# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
 # be used.
 
-INCLUDE_FILE_PATTERNS  = 
+INCLUDE_FILE_PATTERNS  =
 
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
 # instead of the = operator.
 
-PREDEFINED             = 
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
-# this tag can be used to specify a list of macro names that should be expanded. 
-# The macro definition that is found in the sources will be used. 
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      = 
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line, have an all uppercase name, and do not end with a semicolon. Such 
-# function macros are typically used for boiler-plate code, and will confuse 
-# the parser if not removed.
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
 
 SKIP_FUNCTION_MACROS   = YES
 
 #---------------------------------------------------------------------------
-# Configuration::additions related to external references   
+# Configuration::additions related to external references
 #---------------------------------------------------------------------------
 
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
 # does not have to be run to correct the links.
 # Note that each tag file must have a unique name
 # (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen 
+# If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = 
+TAGFILES               =
 
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
 
 GENERATE_TAGFILE       = html/@PROJECT_NAME@.TAGFILE
 
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
 # will be listed.
 
 ALLEXTERNALS           = YES
 
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
-# in the modules index. If set to NO, only the current project's groups will 
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
 # be listed.
 
 EXTERNAL_GROUPS        = YES
 
-# The PERL_PATH should be the absolute path and name of the perl script 
+# The PERL_PATH should be the absolute path and name of the perl script
 # interpreter (i.e. the result of `which perl').
 
 PERL_PATH              = /usr/bin/perl
 
 #---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
+# Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
-# or super classes. Setting the tag to NO turns the diagrams off. Note that 
-# this option is superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
 
 CLASS_DIAGRAMS         = YES
 
-# If set to YES, the inheritance and collaboration graphs will hide 
-# inheritance and usage relations if the target is undocumented 
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
 # or is not a class.
 
 HIDE_UNDOC_RELATIONS   = YES
 
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
 # have no effect if this option is set to NO (the default)
 
 HAVE_DOT               = @DOXYGEN_DOT_FOUND@
 
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
 # the CLASS_DIAGRAMS tag to NO.
 
 CLASS_GRAPH            = YES
 
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
 # class references variables) of the class with other documented classes.
 
 COLLABORATION_GRAPH    = YES
 
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
 # will generate a graph for groups, showing the direct groups dependencies
 
 GROUP_GRAPHS           = YES
 
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
 # Language.
 
 UML_LOOK               = NO
-# UML_LOOK               = YES
 
-# If set to YES, the inheritance and collaboration graphs will show the 
+# If set to YES, the inheritance and collaboration graphs will show the
 # relations between templates and their instances.
 
 TEMPLATE_RELATIONS     = YES
 
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
-# tags are set to YES then doxygen will generate a graph for each documented 
-# file showing the direct and indirect include dependencies of the file with 
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
 # other documented files.
 
 INCLUDE_GRAPH          = YES
 
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
-# documented header file showing the documented files that directly or 
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
 # indirectly include this file.
 
 INCLUDED_BY_GRAPH      = YES
 
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
-# generate a call dependency graph for every global function or class method. 
-# Note that enabling this option will significantly increase the time of a run. 
-# So in most cases it will be better to enable call graphs for selected 
-# functions only using the \callgraph command.
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
 
 CALL_GRAPH             = NO
 
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one.
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
 
 GRAPHICAL_HIERARCHY    = YES
 
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
 # in a graphical way. The dependency relations are determined by the #include
 # relations between the files in the directories.
 
 DIRECTORY_GRAPH        = YES
 
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
 
 DOT_IMAGE_FORMAT       = png
 
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
 # found. If left blank, it is assumed the dot tool can be found in the path.
 
 DOT_PATH               = @DOXYGEN_DOT_EXECUTABLE_PATH@
 
-# The DOTFILE_DIRS tag can be used to specify one or more directories that 
-# contain dot files that are included in the documentation (see the 
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
 # \dotfile command).
 
-DOTFILE_DIRS           = 
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, which results in a white background. 
-# Warning: Depending on the platform used, enabling this option may lead to 
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
-# read).
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
 
 DOT_TRANSPARENT        = NO
 
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
 # support this, this feature is disabled by default.
-# JW
-# DOT_MULTI_TARGETS      = NO
+
 DOT_MULTI_TARGETS      = YES
 
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
-# generate a legend page explaining the meaning of the various boxes and 
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
 # arrows in the dot generated graphs.
 
 GENERATE_LEGEND        = YES
 
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
-# remove the intermediate dot files that are used to generate 
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
 # the various graphs.
 
 DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be 
-# used. If set to NO the values of all tags below this one will be ignored.
-
-# JW SEARCHENGINE           = NO
-SEARCHENGINE           = NO

=== modified file 'doc/c/manual/indexpage.dox'
--- doc/c/manual/indexpage.dox	2011-08-26 23:36:24 +0000
+++ doc/c/manual/indexpage.dox	2012-08-19 03:54:29 +0000
@@ -23,7 +23,7 @@
         written in C.
   </ul>
 
-  To start with, this documentation provides a <a class="el" href="../examples/cexamples.c">set of examples</a> that demonstrate 
+  To start with, this documentation provides a <a class="el" href="examples.html">set of examples</a> that demonstrate 
   some features.
  */
 

=== modified file 'doc/code/CMakeLists.txt'
--- doc/code/CMakeLists.txt	2011-08-10 09:40:29 +0000
+++ doc/code/CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -33,20 +33,20 @@
   FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/headers_svg/)
 
   # Add the headers_svg command for which a working zorba cmd is required.
-  ADD_CUSTOM_TARGET(headers_svg
-    ${ZORBA_EXE}
-      --omit-xml-declaration
-      -f
-      -q "\"${CMAKE_CURRENT_SOURCE_DIR}/headers_svg/generate-headers-dependencies-svg.xq\""
-      -e "\"doxygenCodePath:=${CMAKE_CURRENT_BINARY_DIR}/html\""
-      -o "\"${CMAKE_CURRENT_BINARY_DIR}/headers_svg/headers.svg\""
-      COMMENT "Building header dependencies SVG..."
-  )
-  SET_TARGET_PROPERTIES (headers_svg PROPERTIES
-    EXCLUDE_FROM_DEFAULT_BUILD 1
-    FOLDER "Docs"
-  )
+#  ADD_CUSTOM_TARGET(headers_svg
+#    ${ZORBA_EXE}
+#      --omit-xml-declaration
+#      -f
+#      -q "\"${CMAKE_CURRENT_SOURCE_DIR}/headers_svg/generate-headers-dependencies-svg.xq\""
+#      -e "\"doxygenCodePath:=${CMAKE_CURRENT_BINARY_DIR}/html\""
+#      -o "\"${CMAKE_CURRENT_BINARY_DIR}/headers_svg/headers.svg\""
+#      COMMENT "Building header dependencies SVG..."
+#  )
+#  SET_TARGET_PROPERTIES (headers_svg PROPERTIES
+#    EXCLUDE_FROM_DEFAULT_BUILD 1
+#    FOLDER "Docs"
+#  )
   
-  ADD_DEPENDENCIES(headers_svg "codedocs")
+#  ADD_DEPENDENCIES(headers_svg "codedocs")
   
 ENDIF(NOT ZORBA_WITH_FILE_ACCESS)
\ No newline at end of file

=== modified file 'doc/code/headers_svg/zorba_headers_dependencies.xqi'
--- doc/code/headers_svg/zorba_headers_dependencies.xqi	2011-08-18 19:46:33 +0000
+++ doc/code/headers_svg/zorba_headers_dependencies.xqi	2012-08-19 03:54:29 +0000
@@ -24,14 +24,14 @@
 import module namespace html = "http://www.zorba-xquery.com/modules/converters/html";;
 import module namespace functx = "http://www.functx.com/";;
 
-declare namespace ann = "http://www.zorba-xquery.com/annotations";;
+declare namespace an = "http://www.zorba-xquery.com/annotations";;
 
 declare variable $z:headersCollector := <headers/>;
 
 declare variable $z:dependenciesCollector := <dependencies/>;
 
 (: This function fills the $z:headersCollector :)
-declare %private %ann:sequential function z:collect-header (
+declare %private %an:sequential function z:collect-header (
   $folderPath as xs:string,
   $headerName as xs:string,
   $dependenciesFileName as xs:string) 
@@ -43,7 +43,7 @@
 };
 
 (: This function fills the $z:dependenciesCollector :)
-declare %private %ann:sequential function z:collect-dependency (
+declare %private %an:sequential function z:collect-dependency (
   $header1 as xs:string,
   $header1URL as xs:string,
   $header2Original as xs:string,
@@ -57,7 +57,7 @@
 };
 
 (: This function collects the information from files.html file :)
-declare %ann:sequential function z:fill-headersCollector (
+declare %an:sequential function z:fill-headersCollector (
   $doxygenCodePath as xs:string
 )
 {
@@ -136,7 +136,7 @@
 
 
 (: This function collects the information from every *.html file generated by Doxygen:)
-declare %ann:sequential function z:fill-dependenciesCollector (
+declare %an:sequential function z:fill-dependenciesCollector (
     $doxygenCodePath as xs:string
 )
 {
@@ -228,4 +228,4 @@
     ',z:get-nodes($doxygenCodePath),';
     ',z:get-edges(),';
 }')
-};
\ No newline at end of file
+};

=== added directory 'doc/csharp'
=== added file 'doc/csharp/CMakeLists.txt'
--- doc/csharp/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ doc/csharp/CMakeLists.txt	2012-08-19 03:54:29 +0000
@@ -0,0 +1,35 @@
+# 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.
+
+ZORBA_DOXYGEN ("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" "csharpdocs")
+
+IF (DOXYGEN_FOUND)
+  ADD_DEPENDENCIES (doc "csharpdocs")
+
+  CONFIGURE_FILE (
+    ${CMAKE_CURRENT_SOURCE_DIR}/../style/rtab_b.gif
+    ${CMAKE_CURRENT_BINARY_DIR}/html/rtab_b.gif
+    COPYONLY
+  )
+  CONFIGURE_FILE (
+    ${CMAKE_CURRENT_SOURCE_DIR}/../style/rtab_r.gif
+    ${CMAKE_CURRENT_BINARY_DIR}/html/rtab_r.gif
+    COPYONLY
+  )
+  CONFIGURE_FILE (
+    ${CMAKE_CURRENT_SOURCE_DIR}/../style/rtab_l.gif
+    ${CMAKE_CURRENT_BINARY_DIR}/html/rtab_l.gif
+    COPYONLY
+  )
+ENDIF (DOXYGEN_FOUND)

=== added file 'doc/csharp/doxy.config.in'
--- doc/csharp/doxy.config.in	1970-01-01 00:00:00 +0000
+++ doc/csharp/doxy.config.in	2012-08-19 03:54:29 +0000
@@ -0,0 +1,1767 @@
+# Doxyfile 1.7.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Zorba C#-API"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         = @ZORBA_MAJOR_NUMBER@.@ZORBA_MINOR_NUMBER@.@ZORBA_PATCH_NUMBER@
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = @CMAKE_CURRENT_BINARY_DIR@
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = @CMAKE_SOURCE_DIR@/src \
+                         @CMAKE_BINARY_DIR@/src
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = @CMAKE_SOURCE_DIR@/include \
+                         @CMAKE_BINARY_DIR@/include
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 2
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = YES
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = YES
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = YES
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = @DOXY_WARN_FORMAT@
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           = Doc/doxy.log
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = @CMAKE_SOURCE_DIR@/swig \
+                         @CMAKE_CURRENT_SOURCE_DIR@/manual
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          = *.cs \
+						 *.h \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to directory from which doxygen is run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = */.svn \
+                         */.svn/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           = @CMAKE_CURRENT_BINARY_DIR@/examples
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *.cs
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             = @CMAKE_CURRENT_SOURCE_DIR@
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 2
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is adviced to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            = @CMAKE_CURRENT_SOURCE_DIR@/../style/header.html
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            = @CMAKE_CURRENT_SOURCE_DIR@/../style/footer.html
+
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML documentation will contain the timesstamp.
+
+HTML_TIMESTAMP         = NO
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = @CMAKE_CURRENT_SOURCE_DIR@/../style/stylesheet.css
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters";>
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes";>
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = @LATEX_COMPILER@
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = @MAKEINDEX_COMPILER@
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = YES
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen gene

Follow ups